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
});

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
Programming Feeds
Learn something new everyday on Devsheet