Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4d9fdda7
Commit
4d9fdda7
authored
May 06, 2016
by
Ian Hickson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ModalPosition (for real)
It has no more clients. Follow-up to #3734. Fixes #2484
parent
bd564a02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
32 deletions
+7
-32
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+7
-32
No files found.
packages/flutter/lib/src/widgets/routes.dart
View file @
4d9fdda7
...
...
@@ -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
<
T
>
extends
TransitionRoute
<
T
>
with
LocalHistoryRoute
<
T
>
{
ModalRoute
({
Completer
<
T
>
completer
,
...
...
@@ -477,11 +455,6 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
// The API for subclasses to override - used by _ModalScope
/// Override to provide a position for this route within the [Navigator]'s [Overlay].
///
/// By default, the route expands to fill the entire overlay.
ModalPosition
getPosition
(
BuildContext
context
)
=>
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<T> extends TransitionRoute<T> with LocalHistoryRoute<T
final
GlobalKey
_subtreeKey
=
new
GlobalKey
();
final
PageStorageBucket
_storageBucket
=
new
PageStorageBucket
();
// one of the builders
Widget
_buildModalBarrier
(
BuildContext
context
)
{
Widget
barrier
;
if
(
barrierColor
!=
null
)
{
...
...
@@ -587,6 +561,7 @@ abstract class ModalRoute<T> extends TransitionRoute<T> with LocalHistoryRoute<T
);
}
// one of the builders
Widget
_buildModalScope
(
BuildContext
context
)
{
return
new
_ModalScope
(
key:
_scopeKey
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment