📜  颤振构建屏幕后如何执行功能 - Dart代码示例

📅  最后修改于: 2022-03-11 14:48:05.756000             🧑  作者: Mango

代码示例2
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));