Skip to content

Instantly share code, notes, and snippets.

@FlutterZeroGit
Last active August 18, 2022 07:06
Show Gist options
  • Save FlutterZeroGit/9ab2c9fc21cb3b7a1ff509757d7d525a to your computer and use it in GitHub Desktop.
Save FlutterZeroGit/9ab2c9fc21cb3b7a1ff509757d7d525a to your computer and use it in GitHub Desktop.
非同期処理: async/awaitなし
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