Answered by : clumsy-cod-grl1ycp3etqn
Future.delayed(Duration(milliseconds: 100), () { // Do something
});
Source : https://stackoverflow.com/questions/49471063/how-to-run-code-after-some-delay-in-flutter | Last Update : Wed, 09 Dec 20
Answered by : clumsy-cod-grl1ycp3etqn
Timer(Duration(seconds: 5), () { print(" This line is execute after 5 seconds");
});
Source : https://stackoverflow.com/questions/49471063/how-to-run-code-after-some-delay-in-flutter | Last Update : Wed, 09 Dec 20
Answered by : glamorous-gharial-a6f19c3x24eu
Future.delayed(const Duration(milliseconds: 500), () {
// Here you can write your code setState(() { // Here you can write your code for open new view });
});
Source : https://stackoverflow.com/questions/49471063/how-to-run-code-after-some-delay-in-flutter | Last Update : Wed, 24 Jun 20
Answered by : aguda-john
// just to delay 500 miliSeconds
await Future.delayed(const Duration(milliseconds: 500));
Source : | Last Update : Thu, 23 Jun 22
Answered by : strange-starling-1vjjcrkvt0he
void main() async { print('Started at ${DateTime.now()}'); final time = await Future.delayed(Duration(seconds: 2)).then((value) => DateTime.now()); print('Awaited time was at $time');
}
Source : https://blog.logrocket.com/understanding-flutter-streams/ | Last Update : Fri, 06 May 22
Answered by : successful-sardine-e44pvl59qsik
In Async Code await Future.delayed(Duration(seconds: 1));
In Sync Code import 'dart:io'; sleep(Duration(seconds:1));
Source : https://stackoverflow.com/questions/18449846/how-can-i-sleep-a-dart-program | Last Update : Wed, 13 Jul 22
Answered by : kalyan
Future.delayed(Duration(milliseconds: 100), () { After milliseconds of 100
you will write function it will executes
});
Source : | Last Update : Wed, 06 Jul 22
Answered by : swathi-undavalli
Future myFuture() async {
await new Future.delayed(new Duration(seconds: 3));
//return your_main_future_code_here;
}
Source : https://stackoverflow.com/questions/49072957/flutter-dart-open-a-view-after-a-delay | Last Update : Mon, 08 Aug 22