mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
If you change the RenderObject tree between frames, you'll assert if you subsequently hit test. So e.g. if you get two button presses back to back, and you mutate the tree synchronously in response to the first one, the second will assert. This adds an onBuild callback to WidgetToRenderBoxAdapter to make it easier to do the updates at the right time, i.e., during widget build. It'll be called whenever you rebuild the WidgetToRenderBoxAdapter itself, so all you have to do to use it is call setState() on whoever is building the WidgetToRenderBoxAdapter.
Small examples of the Flutter widget framework
To run these, open a terminal in this directory and use the following command:
flutter start --checked -t foo.dart
...where foo.dart is the file you want to run.