From 85d42fb39681b675519da07ed65cc9b491cb6fb3 Mon Sep 17 00:00:00 2001 From: xster Date: Wed, 14 Mar 2018 18:37:53 -0700 Subject: [PATCH] Wrap route transitions above the transition as well to prevent repaints (#15534) --- packages/flutter/lib/src/widgets/routes.dart | 30 +++++++++++--------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 34be56e526..6af88ff0bb 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -466,19 +466,23 @@ class _ModalScopeState extends State<_ModalScope> { offstage: widget.route.offstage, child: new IgnorePointer( ignoring: widget.route.animation?.status == AnimationStatus.reverse, - child: widget.route.buildTransitions( - context, - widget.route.animation, - widget.route.secondaryAnimation, - new RepaintBoundary( - child: new PageStorage( - key: widget.route._subtreeKey, - bucket: widget.route._storageBucket, - child: new _ModalScopeStatus( - route: widget.route, - isCurrent: widget.route.isCurrent, - canPop: widget.route.canPop, - child: widget.page, + // Keep the transition between repaint boundaries so we don't trigger + // deep repaints of the render tree above or below the transition. + child: new RepaintBoundary( + child: widget.route.buildTransitions( + context, + widget.route.animation, + widget.route.secondaryAnimation, + new RepaintBoundary( + child: new PageStorage( + key: widget.route._subtreeKey, + bucket: widget.route._storageBucket, + child: new _ModalScopeStatus( + route: widget.route, + isCurrent: widget.route.isCurrent, + canPop: widget.route.canPop, + child: widget.page, + ), ), ), ),