Skip to content

Commit 15c5b70

Browse files
authored
Merge pull request DevScript#173 from hifzakanwal/main
Async_programming
2 parents 685b06d + d3815d7 commit 15c5b70

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//Async-programming where we can move to another task before the previous one finishes.
2+
//Future, async, await
3+
4+
main() async {
5+
print("Main");
6+
await futureFun();
7+
print("Last Statement");
8+
}
9+
10+
Future<void> futureFun() async {
11+
Future.delayed(Duration(seconds: 5), () {
12+
print("Future Function");
13+
});
14+
}

0 commit comments

Comments
 (0)