Answers for "flutter how to execute function after building screen"

1

flutter on build complete

void initState() {
    super.initState();
    WidgetsBinding.instance.addPostFrameCallback((_) => yourFunction(context));
  }
Posted by: Guest on September-14-2020
0

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));
Posted by: Guest on September-28-2020

Code answers related to "flutter how to execute function after building screen"

Code answers related to "Dart"

Browse Popular Code Answers by Language