📜  构建后颤动运行代码 - 无论代码示例

📅  最后修改于: 2022-03-11 15:00:42.403000             🧑  作者: Mango

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