Search code snippets, questions, articles...

Add some delay before executing the code in Flutter

If you want to add some delay or want to execute your code after a fixed time you can use Future.delayed in Flutter.
Future.delayed(const Duration(milliseconds: 500), () {
    // DO SOMETHING HERE
});
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

In the code snippet, we are adding a delay of 500 milliseconds before calling a function or a piece of code.

Search Index Data (The code snippet can also be found with below search text)

settimeout Flutter
Was this helpful?
0 Comments