Last active
August 18, 2022 07:06
-
-
Save FlutterZeroGit/9ab2c9fc21cb3b7a1ff509757d7d525a to your computer and use it in GitHub Desktop.
非同期処理: async/awaitなし
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main() { | |
task1(); | |
String result = task2(); | |
task3(result); | |
} | |
void task1() { | |
print('タスク1完了'); | |
} | |
String task2() { | |
String result = 'タスク2未完了'; | |
Future.delayed(Duration(seconds: 3), () { | |
result = 'タスク2完了'; | |
}); | |
return result; | |
} | |
void task3(task2) { | |
print('タスク2結果: $task2'); | |
print('タスク3完了'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment