728x90
int addNum1(List num, [int a]) {
// code
return $variable;
}
List num = [1, 2, 3, 4, 5];
addNum1(List num);
// [int a]라고 된 경우는 생략 가능
int addNum2(List num, int a, {
int b,
int c,
}) {
// code
}
List num = ['a', 'b', 'c'];
addNum2(List num, 1, b: 1, c:4);
반응형
'Programming > Dart, Flutter' 카테고리의 다른 글
캐스케이드(Cascade Notation) (0) | 2022.01.11 |
---|---|
얕은 복사(shallow copy), 깊은 복사(deep copy) (0) | 2022.01.11 |
ListView (0) | 2021.12.30 |
Error: The argument type 'String' can't be assigned to the parameter type 'Uri'. (0) | 2021.12.30 |
Fixed length List (0) | 2021.01.28 |
Comments