different ways of using future 1. 1 2 3 4void main() async { var result = await Future.delayed(Duration(seconds: 10), () => 100); print("Result: $result"); } 2. 1 2 3 4 5 6 7Future<int> getFutureResut() { return Future.delayed(Duration(seconds: 5), () => 100); } void main() async { print("Result: ${await getFutureResut()}"); } 3. 1 2 3 4 5 6 7 8 9 10void printFutureResult() { var result = 100; Future.delayed(Duration(seconds: 10), () { print("Result: ${result}"); }); } void main() { printFutureResult(); } Comments