[Dart] String interpolation
String interpolationDart
[Ko]
String interpolation : 변수 앞에 $(달러 사인)를 사용, 2단계 이상 depth의 변수 사용시는 $를 포함하는 전체 변수를 { } 로 감싸줌.
var number = 5;
Expanded(
// flex: 1,
child: FlatButton(
onPressed: () {
print('Left button got pressed.');
},
child: Image.asset('images/aaa$number.png')),
),
=========================================================
[En]
String interpolation: Use $ (dollar sign) in front of the variable, and when using a variable with depth of 2 or more levels, wrap the entire variable including $ with {}.
var number = 5;
Expanded(
// flex: 1,
child: FlatButton(
onPressed: () {
print('Left button got pressed.');
},
child: Image.asset('images/aaa$number.png')),
),