From 4d9fdda759b43f35c99090639e7a8e8f2f899f3f Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Fri, 6 May 2016 09:46:51 -0700 Subject: [PATCH] Remove ModalPosition (for real) It has no more clients. Follow-up to #3734. Fixes #2484 --- packages/flutter/lib/src/widgets/routes.dart | 39 ++++---------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/packages/flutter/lib/src/widgets/routes.dart b/packages/flutter/lib/src/widgets/routes.dart index 444b5772ea..518a12efe9 100644 --- a/packages/flutter/lib/src/widgets/routes.dart +++ b/packages/flutter/lib/src/widgets/routes.dart @@ -422,37 +422,15 @@ class _ModalScopeState extends State<_ModalScope> { key: new GlobalObjectKey(config.route), child: new RepaintBoundary(child: contents) ); - ModalPosition position = config.route.getPosition(context); - if (position == null) - return contents; - return new Positioned( - top: position.top, - right: position.right, - bottom: position.bottom, - left: position.left, - child: contents - ); + return contents; } } -/// Where a [ModalRoute] should be positioned within the [Navigator]'s [Overlay]. -class ModalPosition { - const ModalPosition({ this.top, this.right, this.bottom, this.left }); - - /// The offset of the route's top edge from the top of the overlay. - final double top; - - /// The offset of the route's right edge from the right of the overlay. - final double right; - - /// The offset of the route's bottom edge from the bottom of the overlay. - final double bottom; - - /// The offset of the route's left edge from the left of the overlay. - final double left; -} - /// A route that blocks interaction with previous routes. +/// +/// ModalRoutes cover the entire [Navigator]. They are not necessarily [opaque], +/// however; for example, a pop-up menu uses a ModalRoute but only shows the menu +/// in a small box overlapping the previous route. abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute { ModalRoute({ Completer completer, @@ -477,11 +455,6 @@ abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute null; - /// Override this function to build the primary content of this route. /// /// * [context] The context in which the route is being built. @@ -562,6 +535,7 @@ abstract class ModalRoute extends TransitionRoute with LocalHistoryRoute extends TransitionRoute with LocalHistoryRoute