Last active
March 29, 2022 22:50
-
-
Save haverchuck/e28e1c850dbf41ec895aed19e62daacb to your computer and use it in GitHub Desktop.
Dart Future Processing Demonstration
This file contains hidden or 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
import 'dart:async'; | |
void main() async{ | |
Future((){ | |
Future.delayed(const Duration(milliseconds: 1000), () { | |
print('running Future1 with delay...'); | |
}); | |
}).then((_){ | |
print('Future1 is complete'); | |
}); | |
Future((){ | |
print('Running Future2'); | |
}).then((_){ | |
print('Future2 is complete'); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment