-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Internal: b/146212303
Related to: #11655
Currently, there's an optimization performed by Navigator/Overlay such that when a full-screen opaque content is placed above another content, the content behind will stop painting.
It is useful, but at the same time there's an irony:
The act of flagging the previously visible widget tree as no longer needing to be painted forces the entire associated widget tree to rebuild.
From my understanding, this is caused by a change in the depth of the associated widget tree during the transition. This, therefore, cause the widget tree to be deactivated and reactivated for a frame, which calls build/didChangeDependencies on everything.
It is suboptimal, especially considering the widget tree is actually no longer visible.
My theory is that is should be possible to fix this inconvenience by a change on this line
| return _Theatre( |
_Theatre(
onstage: Stack(
fit: StackFit.expand,
children: onstageChildren.reversed.toList(growable: false),
),
offstage: offstageChildren,
);to:
_Theatre(
// somehow make _RenderTheatre fill the gap of the missing Stack
onstage: onstageChildren.reversed.toList(growable: false),
offstage: offstageChildren,
);This should remove the reparenting, which should no longer unnecessarily rebuild the no longer visible widget tree.