Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter how to execute function after building screen

QUESTIONS: Flutter: Run method on Widget build complete

ANSWERS:

1) WidgetsBinding.instance.addPostFrameCallback((_) => yourFunc(context)); //Recomended

2) Future.delayed(Duration.zero, () => yourFunc(context));

3) Timer.run(() => yourFunc(context));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #flutter #execute #function #building #screen
ADD COMMENT
Topic
Name
1+9 =