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
Schaban
2020-12-10 21:20:34 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2bed458c07824470d46df4b263da2adeedba1668
2bed458c
1 parent
b1ef6544
Middlewares with initial Routes
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
91 deletions
lib/get_navigation/src/root/get_cupertino_app.dart
lib/get_navigation/src/root/get_material_app.dart
lib/get_navigation/src/root/get_cupertino_app.dart
View file @
2bed458
...
...
@@ -191,50 +191,8 @@ class GetCupertinoApp extends StatelessWidget {
return
PageRedirect
(
settings
,
unknownRoute
).
page
();
}
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
{
final
match
=
Get
.
routeTree
.
matchRoute
(
name
);
Get
.
parameters
=
match
?.
parameters
;
//Route can be nullable, just pass the unknown route
if
(
match
?.
route
==
null
)
{
return
[
GetPageRoute
(
page:
unknownRoute
.
page
,
parameter:
unknownRoute
.
parameter
,
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
unknownRoute
.
curve
,
opaque:
unknownRoute
.
opaque
,
routeName:
unknownRoute
.
name
,
customTransition:
unknownRoute
.
customTransition
,
binding:
unknownRoute
.
binding
,
bindings:
unknownRoute
.
bindings
,
transitionDuration:
(
unknownRoute
.
transitionDuration
??
Get
.
defaultTransitionDuration
),
transition:
unknownRoute
.
transition
,
popGesture:
unknownRoute
.
popGesture
,
fullscreenDialog:
unknownRoute
.
fullscreenDialog
,
)
];
}
return
[
GetPageRoute
(
page:
match
.
route
.
page
,
parameter:
match
.
route
.
parameter
,
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
match
.
route
.
curve
,
opaque:
match
.
route
.
opaque
,
routeName:
match
.
route
.
name
,
binding:
match
.
route
.
binding
,
bindings:
match
.
route
.
bindings
,
transitionDuration:
(
match
.
route
.
transitionDuration
??
Get
.
defaultTransitionDuration
),
transition:
match
.
route
.
transition
,
popGesture:
match
.
route
.
popGesture
,
fullscreenDialog:
match
.
route
.
fullscreenDialog
,
)
];
}
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
=>
[
PageRedirect
(
RouteSettings
(
name:
name
),
unknownRoute
).
page
()];
@override
Widget
build
(
BuildContext
context
)
=>
GetBuilder
<
GetMaterialController
>(
...
...
lib/get_navigation/src/root/get_material_app.dart
View file @
2bed458
...
...
@@ -198,54 +198,11 @@ class GetMaterialApp extends StatelessWidget {
initialRoute
=
null
,
super
(
key:
key
);
Route
<
dynamic
>
generator
(
RouteSettings
settings
)
{
return
PageRedirect
(
settings
,
unknownRoute
).
page
();
}
Route
<
dynamic
>
generator
(
RouteSettings
settings
)
=>
PageRedirect
(
settings
,
unknownRoute
).
page
();
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
{
final
match
=
Get
.
routeTree
.
matchRoute
(
name
);
Get
.
parameters
=
match
?.
parameters
;
//Route can be nullable, just pass the unknown route
if
(
match
?.
route
==
null
)
{
return
[
GetPageRoute
(
page:
unknownRoute
.
page
,
parameter:
unknownRoute
.
parameter
,
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
unknownRoute
.
curve
,
opaque:
unknownRoute
.
opaque
,
routeName:
unknownRoute
.
name
,
customTransition:
unknownRoute
.
customTransition
,
binding:
unknownRoute
.
binding
,
bindings:
unknownRoute
.
bindings
,
transitionDuration:
(
unknownRoute
.
transitionDuration
??
Get
.
defaultTransitionDuration
),
transition:
unknownRoute
.
transition
,
popGesture:
unknownRoute
.
popGesture
,
fullscreenDialog:
unknownRoute
.
fullscreenDialog
,
)
];
}
return
[
GetPageRoute
(
page:
match
.
route
.
page
,
parameter:
match
.
route
.
parameter
,
settings:
RouteSettings
(
name:
name
,
arguments:
null
),
curve:
match
.
route
.
curve
,
opaque:
match
.
route
.
opaque
,
binding:
match
.
route
.
binding
,
routeName:
match
.
route
.
name
,
bindings:
match
.
route
.
bindings
,
transitionDuration:
(
match
.
route
.
transitionDuration
??
Get
.
defaultTransitionDuration
),
transition:
match
.
route
.
transition
,
popGesture:
match
.
route
.
popGesture
,
fullscreenDialog:
match
.
route
.
fullscreenDialog
,
)
];
}
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
=>
[
PageRedirect
(
RouteSettings
(
name:
name
),
unknownRoute
).
page
()];
@override
Widget
build
(
BuildContext
context
)
=>
GetBuilder
<
GetMaterialController
>(
...
...
Please
register
or
login
to post a comment