dart sleep 1 second code example
Example 1: flutter wait for specific time
await Future.delayed(const Duration(seconds: 2), (){});
Example 2: sleep in dart
import 'dart:io';
main() {
sleep(const Duration(seconds:1));
}
await Future.delayed(const Duration(seconds: 2), (){});
import 'dart:io';
main() {
sleep(const Duration(seconds:1));
}