runApp builds root widget by calling attachRootWidget and schedule a warm up frame. Sometimes, the platform might flush user setting to dirty the widget tree before the scheduled warm up frame is drawn. This will cause the widget tree to rebuild again when drawing warm up frame.
Ideally, we should only need to build widget tree once before warm up frame is drawn. The proposal is to make sure we do not allow interference in the between attachRootWidget and warm up frame. If something does need to dirty the widget tree, it should happen either before attachRootWidget or after warm up frame is drawn.
For a more detailed explanation of this issue please check the description in this PR
If you would like to schedule Timer during runApp, there are two cases you would want to consider. If it requires widget tree to be built, you can schedule a Timer after the runApp.
If it does not require widget tree to be built, you can schedule a MicroTask or Timer before runApp is called.