-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Hi thanks for the wonderful framework! I am filing a series of PRs to fix a category of bugs: RenderObject will not be updated when users provide new values.
Bug description: As we know, when implementing a RenderObjectWidget, we need to correctly implement createRenderObject and updateRenderObject. If we forget to set a field in updateRenderObject, that value will never be updated when user provides new values, i.e. a bug.
How I find it: At dart-code-checker/dart-code-metrics#996, I proposed that we could write a linter to automatically check updateRenderObject should be consistent with createRenderObject, and apply the linter to flutter framework. Then, in dart-code-checker/dart-code-metrics#1004, @incendial implemented it and applied it. Then the bugs were founds.
Thus, thanks for @incendial for implementing the linter and running it to scan flutter code!
By the way, I split the work into multiple PRs, because Flutter's official contributing guide points to this article, saying that:
One PR for one fix, no matter how small the fix is. Consider if you land three changes in a single PR, and due to some reasons maintainers need to revert one change, your other two changes will also get reverted along with it. It also helps the team to keep track of changes and review them easily.
So I submit one PR for one fix.
Related PRs:
-
PerformanceOverlay's multiple fields are not updated when the user wants to update it #112039 - Fix logical error in TimePickerDialog - the RenderObject forgets to update fields #112040
- Fix CupertinoAlertDialog and CupertinoActionSheet, which mis-behave when orientation changes #112041
- Fix SliverScrollingPersistentHeader not able to update stretchConfiguration #112042
- Fix SliverPinnedPersistentHeader, also not able to update stretchConfiguration and showOnScreenConfiguration #112043
- Add assertion to _CupertinoSwitchRenderObjectWidget, otherwise it is confusing why updateRenderObject omits state update #112044
- Fix RenderEditable not able to update backgroundCursorColor when the user provides a new one #112045