반응형
void main() async {
Future<String> name = Future.value('값');
Future<int> number = Future.value(1);
Future<bool> boolean = Future.value(false);
await addNumbers(1,1);
await addNumbers(2,2);
}
Future<void> addNumbers(int number1, int number2) async {
print('계산시작 : $number1 + $number2');
print('계산완료 : $number1 + $number2 = ${number1 + number2}');
print('함수완료 : $number1 + $number2');
}
출력
계산시작 : 1 + 1
계산완료 : 1 + 1 = 2
함수완료 : 1 + 1
계산시작 : 2 + 2
계산완료 : 2 + 2 = 4
함수완료 : 2 + 2
반응형
댓글