Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
jonataslaw
2019-11-15 16:17:07 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2019-11-15 16:17:07 -0300
Commit
885409295977d785c8c7eaad01f558c8f5e1dbd0
88540929
1 parent
0d6f4af9
Delete material.dart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
110 deletions
lib/src/material.dart
lib/src/material.dart
deleted
100644 → 0
View file @
0d6f4af
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/material.dart'
;
/// A modal route that replaces the entire screen with a platform-adaptive
/// transition.
///
/// For Android, the entrance transition for the page slides the page upwards
/// and fades it in. The exit transition is the same, but in reverse.
///
/// The transition is adaptive to the platform and on iOS, the page slides in
/// from the right and exits in reverse. The page also shifts to the left in
/// parallax when another page enters to cover it. (These directions are flipped
/// in environments with a right-to-left reading direction.)
///
/// By default, when a modal route is replaced by another, the previous route
/// remains in memory. To free all the resources when this is not necessary, set
/// [maintainState] to false.
///
/// The `fullscreenDialog` property specifies whether the incoming page is a
/// fullscreen modal dialog. On iOS, those pages animate from the bottom to the
/// top rather than horizontally.
///
/// The type `T` specifies the return type of the route which can be supplied as
/// the route is popped from the stack via [Navigator.pop] by providing the
/// optional `result` argument.
///
/// See also:
///
/// * [PageTransitionsTheme], which defines the default page transitions used
/// by [MaterialPageRoute.buildTransitions].
class
GetRoute
<
T
>
extends
PageRoute
<
T
>
{
/// Construct a MaterialPageRoute whose contents are defined by [builder].
///
/// The values of [builder], [maintainState], and [fullScreenDialog] must not
/// be null.
GetRoute
({
@required
this
.
builder
,
RouteSettings
settings
,
this
.
opaque
=
true
,
this
.
maintainState
=
true
,
bool
fullscreenDialog
=
false
,
})
:
assert
(
builder
!=
null
),
assert
(
maintainState
!=
null
),
assert
(
fullscreenDialog
!=
null
),
assert
(
opaque
!=
null
),
super
(
settings:
settings
,
fullscreenDialog:
fullscreenDialog
);
/// Builds the primary contents of the route.
final
WidgetBuilder
builder
;
@override
final
bool
maintainState
;
/// Allows you to set opaque to false to prevent route reconstruction.
@override
final
bool
opaque
;
@override
Duration
get
transitionDuration
=>
const
Duration
(
milliseconds:
300
);
@override
Color
get
barrierColor
=>
null
;
@override
String
get
barrierLabel
=>
null
;
@override
bool
canTransitionFrom
(
TransitionRoute
<
dynamic
>
previousRoute
)
{
return
previousRoute
is
GetRoute
||
previousRoute
is
CupertinoPageRoute
;
}
@override
bool
canTransitionTo
(
TransitionRoute
<
dynamic
>
nextRoute
)
{
// Don't perform outgoing animation if the next route is a fullscreen dialog.
return
(
nextRoute
is
GetRoute
&&
!
nextRoute
.
fullscreenDialog
)
||
(
nextRoute
is
CupertinoPageRoute
&&
!
nextRoute
.
fullscreenDialog
);
}
@override
Widget
buildPage
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondaryAnimation
,
)
{
final
Widget
result
=
builder
(
context
);
assert
(()
{
if
(
result
==
null
)
{
throw
FlutterError
.
fromParts
(<
DiagnosticsNode
>[
ErrorSummary
(
'The builder for route "
${settings.name}
" returned null.'
),
ErrorDescription
(
'Route builders must never return null.'
)
]);
}
return
true
;
}());
return
Semantics
(
scopesRoute:
true
,
explicitChildNodes:
true
,
child:
result
,
);
}
@override
Widget
buildTransitions
(
BuildContext
context
,
Animation
<
double
>
animation
,
Animation
<
double
>
secondaryAnimation
,
Widget
child
)
{
final
PageTransitionsTheme
theme
=
Theme
.
of
(
context
).
pageTransitionsTheme
;
return
theme
.
buildTransitions
<
T
>(
this
,
context
,
animation
,
secondaryAnimation
,
child
);
}
@override
String
get
debugLabel
=>
'
${super.debugLabel}
(
${settings.name}
)'
;
}
Please
register
or
login
to post a comment