LayoutBuilder: skip calling builder when constraints are the same (#55414)
Avoid calling `builder` in `ConstrainedLayoutBuilder` when layout constraints are the same. [Design doc](flutter.dev/go/layout-builder-optimization). ## Related Issues Fixes https://github.com/flutter/flutter/issues/6469
This commit is contained in:
@@ -215,6 +215,14 @@ class _BackdropState extends State<Backdrop> with SingleTickerProviderStateMixin
|
||||
value: 1.0,
|
||||
vsync: this,
|
||||
);
|
||||
_controller.addStatusListener((AnimationStatus status) {
|
||||
setState(() {
|
||||
// This is intentionally left empty. The state change itself takes
|
||||
// place inside the AnimationController, so there's nothing to update.
|
||||
// All we want is for the widget to rebuild and read the new animation
|
||||
// state from the AnimationController.
|
||||
});
|
||||
});
|
||||
_frontOpacity = _controller.drive(_frontOpacityTween);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user