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
964dc1fc
Commit
964dc1fc
authored
Sep 24, 2019
by
imzyy
Committed by
Michael Goderbauer
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add fullscreenDialog argument in PageRouteBuilder (#40161)
parent
c19e553d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
pages.dart
packages/flutter/lib/src/widgets/pages.dart
+5
-3
scaffold_test.dart
packages/flutter/test/material/scaffold_test.dart
+21
-0
No files found.
packages/flutter/lib/src/widgets/pages.dart
View file @
964dc1fc
...
...
@@ -56,7 +56,7 @@ class PageRouteBuilder<T> extends PageRoute<T> {
/// Creates a route that delegates to builder callbacks.
///
/// The [pageBuilder], [transitionsBuilder], [opaque], [barrierDismissible],
///
and [maintainState
] arguments must not be null.
///
[maintainState], and [fullscreenDialog
] arguments must not be null.
PageRouteBuilder
({
RouteSettings
settings
,
@required
this
.
pageBuilder
,
...
...
@@ -67,12 +67,14 @@ class PageRouteBuilder<T> extends PageRoute<T> {
this
.
barrierColor
,
this
.
barrierLabel
,
this
.
maintainState
=
true
,
bool
fullscreenDialog
=
false
,
})
:
assert
(
pageBuilder
!=
null
),
assert
(
transitionsBuilder
!=
null
),
assert
(
opaque
!=
null
),
assert
(
barrierDismissible
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
opaque
!=
null
),
super
(
settings:
settings
);
assert
(
fullscreenDialog
!=
null
),
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
);
/// Used build the route's primary contents.
///
...
...
packages/flutter/test/material/scaffold_test.dart
View file @
964dc1fc
...
...
@@ -568,6 +568,15 @@ void main() {
);
}
PageRoute
<
void
>
pageRouteBuilder
()
{
return
PageRouteBuilder
<
void
>(
pageBuilder:
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondaryAnimation
)
{
return
Scaffold
(
appBar:
AppBar
(),
body:
const
Text
(
'Page 2'
));
},
fullscreenDialog:
true
,
);
}
PageRoute
<
void
>
customPageRouteBuilder
()
{
return
_CustomPageRoute
<
void
>(
builder:
(
BuildContext
context
)
{
...
...
@@ -589,6 +598,18 @@ void main() {
await
expectCloseIcon
(
tester
,
TargetPlatform
.
iOS
,
Icons
.
close
,
materialRouteBuilder
);
});
testWidgets
(
'Close button shows correctly with PageRouteBuilder on Android'
,
(
WidgetTester
tester
)
async
{
await
expectCloseIcon
(
tester
,
TargetPlatform
.
android
,
Icons
.
close
,
pageRouteBuilder
);
});
testWidgets
(
'Close button shows correctly with PageRouteBuilder on Fuchsia'
,
(
WidgetTester
tester
)
async
{
await
expectCloseIcon
(
tester
,
TargetPlatform
.
fuchsia
,
Icons
.
close
,
pageRouteBuilder
);
});
testWidgets
(
'Close button shows correctly with PageRouteBuilder on iOS'
,
(
WidgetTester
tester
)
async
{
await
expectCloseIcon
(
tester
,
TargetPlatform
.
iOS
,
Icons
.
close
,
pageRouteBuilder
);
});
testWidgets
(
'Close button shows correctly with custom page route on Android'
,
(
WidgetTester
tester
)
async
{
await
expectCloseIcon
(
tester
,
TargetPlatform
.
android
,
Icons
.
close
,
customPageRouteBuilder
);
});
...
...
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