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