Open p238049y opened 2 years ago
async awaitの実装は面白い 本当に一個一個処理するんやな〜
class Async {
void asynctest2() async {
print("method begin");
print(DateTime.now().toString());
print("data1 start");
print(await asyncFunc("data1", 3));
print("data2 start");
print(await asyncFunc("data2", 2));
print("data3 start");
print(await asyncFunc("data3", 1));
}
flutter: 2022-03-07 22:43:28.725179
flutter: data1 start
flutter: data1:2022-03-07 22:43:31.732364
flutter: data2 start
flutter: data2:2022-03-07 22:43:33.738063
flutter: data3 start
flutter: data3:2022-03-07 22:43:34.743142
https://zenn.dev/kazutxt/books/flutter_practice_introduction/viewer/intermediate_async をやってみよう