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
Jonny Borges
2021-03-04 00:01:46 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
abae8916b16b48686a736f681c4a4bf15dd8a829
abae8916
1 parent
71921028
solving dart migrate errors pt 2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
102 deletions
lib/get_navigation/src/root/get_cupertino_app.dart
lib/get_navigation/src/root/get_material_app.dart
lib/get_navigation/src/root/parse_route.dart
lib/get_navigation/src/root/root_controller.dart
lib/get_navigation/src/routes/default_route.dart
lib/get_navigation/src/root/get_cupertino_app.dart
View file @
abae891
...
...
@@ -14,12 +14,14 @@ class GetCupertinoApp extends StatelessWidget {
this
.
theme
,
this
.
navigatorKey
,
this
.
home
,
Map
<
String
,
Widget
Function
(
BuildContext
)>
this
.
routes
=
const
<
String
,
WidgetBuilder
>{},
Map
<
String
,
Widget
Function
(
BuildContext
)>
this
.
routes
=
const
<
String
,
WidgetBuilder
>{},
this
.
initialRoute
,
this
.
onGenerateRoute
,
this
.
onGenerateInitialRoutes
,
this
.
onUnknownRoute
,
List
<
NavigatorObserver
>
this
.
navigatorObservers
=
const
<
NavigatorObserver
>[],
List
<
NavigatorObserver
>
this
.
navigatorObservers
=
const
<
NavigatorObserver
>[],
this
.
builder
,
this
.
translationsKeys
,
this
.
translations
,
...
...
@@ -58,15 +60,7 @@ class GetCupertinoApp extends StatelessWidget {
this
.
highContrastTheme
,
this
.
highContrastDarkTheme
,
this
.
actions
,
})
:
assert
(
routes
!=
null
),
assert
(
navigatorObservers
!=
null
),
assert
(
title
!=
null
),
assert
(
showPerformanceOverlay
!=
null
),
assert
(
checkerboardRasterCacheImages
!=
null
),
assert
(
checkerboardOffscreenLayers
!=
null
),
assert
(
showSemanticsDebugger
!=
null
),
assert
(
debugShowCheckedModeBanner
!=
null
),
routeInformationProvider
=
null
,
})
:
routeInformationProvider
=
null
,
routeInformationParser
=
null
,
routerDelegate
=
null
,
backButtonDispatcher
=
null
,
...
...
@@ -103,7 +97,7 @@ class GetCupertinoApp extends StatelessWidget {
final
ThemeData
?
highContrastTheme
;
final
ThemeData
?
highContrastDarkTheme
;
final
Map
<
Type
,
Action
<
Intent
>>?
actions
;
final
Function
(
Routing
)?
routingCallback
;
final
Function
(
Routing
?
)?
routingCallback
;
final
Transition
?
defaultTransition
;
final
bool
?
opaqueRoute
;
final
VoidCallback
?
onInit
;
...
...
@@ -169,15 +163,7 @@ class GetCupertinoApp extends StatelessWidget {
this
.
defaultGlobalState
,
this
.
getPages
,
this
.
unknownRoute
,
})
:
assert
(
routeInformationParser
!=
null
),
assert
(
routerDelegate
!=
null
),
assert
(
title
!=
null
),
assert
(
showPerformanceOverlay
!=
null
),
assert
(
checkerboardRasterCacheImages
!=
null
),
assert
(
checkerboardOffscreenLayers
!=
null
),
assert
(
showSemanticsDebugger
!=
null
),
assert
(
debugShowCheckedModeBanner
!=
null
),
navigatorObservers
=
null
,
})
:
navigatorObservers
=
null
,
navigatorKey
=
null
,
onGenerateRoute
=
null
,
home
=
null
,
...
...
@@ -248,21 +234,19 @@ class GetCupertinoApp extends StatelessWidget {
child:
builder
==
null
?
child
!
:
builder
!(
context
,
child
),
);
},
title:
title
??
''
,
title:
title
,
onGenerateTitle:
onGenerateTitle
,
color:
color
,
locale:
Get
.
locale
??
locale
,
localizationsDelegates:
localizationsDelegates
,
localeListResolutionCallback:
localeListResolutionCallback
,
localeResolutionCallback:
localeResolutionCallback
,
supportedLocales:
supportedLocales
??
const
<
Locale
>[
Locale
(
'en'
,
'US'
)],
showPerformanceOverlay:
showPerformanceOverlay
??
false
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
??
false
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
??
false
,
showSemanticsDebugger:
showSemanticsDebugger
??
false
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
??
true
,
supportedLocales:
supportedLocales
,
showPerformanceOverlay:
showPerformanceOverlay
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
,
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
)
:
CupertinoApp
(
...
...
@@ -295,21 +279,19 @@ class GetCupertinoApp extends StatelessWidget {
child:
builder
==
null
?
child
!
:
builder
!(
context
,
child
),
);
},
title:
title
??
''
,
title:
title
,
onGenerateTitle:
onGenerateTitle
,
color:
color
,
locale:
Get
.
locale
??
locale
,
localizationsDelegates:
localizationsDelegates
,
localeListResolutionCallback:
localeListResolutionCallback
,
localeResolutionCallback:
localeResolutionCallback
,
supportedLocales:
supportedLocales
??
const
<
Locale
>[
Locale
(
'en'
,
'US'
)],
showPerformanceOverlay:
showPerformanceOverlay
??
false
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
??
false
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
??
false
,
showSemanticsDebugger:
showSemanticsDebugger
??
false
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
??
true
,
supportedLocales:
supportedLocales
,
showPerformanceOverlay:
showPerformanceOverlay
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
,
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
// actions: actions,
));
...
...
lib/get_navigation/src/root/get_material_app.dart
View file @
abae891
...
...
@@ -13,12 +13,14 @@ class GetMaterialApp extends StatelessWidget {
Key
?
key
,
this
.
navigatorKey
,
this
.
home
,
Map
<
String
,
Widget
Function
(
BuildContext
)>
this
.
routes
=
const
<
String
,
WidgetBuilder
>{},
Map
<
String
,
Widget
Function
(
BuildContext
)>
this
.
routes
=
const
<
String
,
WidgetBuilder
>{},
this
.
initialRoute
,
this
.
onGenerateRoute
,
this
.
onGenerateInitialRoutes
,
this
.
onUnknownRoute
,
List
<
NavigatorObserver
>
this
.
navigatorObservers
=
const
<
NavigatorObserver
>[],
List
<
NavigatorObserver
>
this
.
navigatorObservers
=
const
<
NavigatorObserver
>[],
this
.
builder
,
this
.
textDirection
,
this
.
title
=
''
,
...
...
@@ -61,16 +63,7 @@ class GetMaterialApp extends StatelessWidget {
this
.
highContrastTheme
,
this
.
highContrastDarkTheme
,
this
.
actions
,
})
:
assert
(
routes
!=
null
),
assert
(
navigatorObservers
!=
null
),
assert
(
title
!=
null
),
assert
(
debugShowMaterialGrid
!=
null
),
assert
(
showPerformanceOverlay
!=
null
),
assert
(
checkerboardRasterCacheImages
!=
null
),
assert
(
checkerboardOffscreenLayers
!=
null
),
assert
(
showSemanticsDebugger
!=
null
),
assert
(
debugShowCheckedModeBanner
!=
null
),
routeInformationProvider
=
null
,
})
:
routeInformationProvider
=
null
,
routeInformationParser
=
null
,
routerDelegate
=
null
,
backButtonDispatcher
=
null
,
...
...
@@ -111,7 +104,7 @@ class GetMaterialApp extends StatelessWidget {
final
ThemeData
?
highContrastDarkTheme
;
final
Map
<
Type
,
Action
<
Intent
>>?
actions
;
final
bool
debugShowMaterialGrid
;
final
ValueChanged
<
Routing
>?
routingCallback
;
final
ValueChanged
<
Routing
?
>?
routingCallback
;
final
Transition
?
defaultTransition
;
final
bool
?
opaqueRoute
;
final
VoidCallback
?
onInit
;
...
...
@@ -179,16 +172,7 @@ class GetMaterialApp extends StatelessWidget {
this
.
defaultGlobalState
,
this
.
getPages
,
this
.
unknownRoute
,
})
:
assert
(
routeInformationParser
!=
null
),
assert
(
routerDelegate
!=
null
),
assert
(
title
!=
null
),
assert
(
debugShowMaterialGrid
!=
null
),
assert
(
showPerformanceOverlay
!=
null
),
assert
(
checkerboardRasterCacheImages
!=
null
),
assert
(
checkerboardOffscreenLayers
!=
null
),
assert
(
showSemanticsDebugger
!=
null
),
assert
(
debugShowCheckedModeBanner
!=
null
),
navigatorObservers
=
null
,
})
:
navigatorObservers
=
null
,
navigatorKey
=
null
,
onGenerateRoute
=
null
,
home
=
null
,
...
...
@@ -257,25 +241,23 @@ class GetMaterialApp extends StatelessWidget {
child:
builder
==
null
?
child
!
:
builder
!(
context
,
child
),
);
},
title:
title
??
''
,
title:
title
,
onGenerateTitle:
onGenerateTitle
,
color:
color
,
theme:
_
.
theme
??
theme
??
ThemeData
.
fallback
(),
darkTheme:
darkTheme
,
themeMode:
_
.
themeMode
??
themeMode
??
ThemeMode
.
system
,
themeMode:
_
.
themeMode
??
themeMode
,
locale:
Get
.
locale
??
locale
,
localizationsDelegates:
localizationsDelegates
,
localeListResolutionCallback:
localeListResolutionCallback
,
localeResolutionCallback:
localeResolutionCallback
,
supportedLocales:
supportedLocales
??
const
<
Locale
>[
Locale
(
'en'
,
'US'
)],
debugShowMaterialGrid:
debugShowMaterialGrid
??
false
,
showPerformanceOverlay:
showPerformanceOverlay
??
false
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
??
false
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
??
false
,
showSemanticsDebugger:
showSemanticsDebugger
??
false
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
??
true
,
supportedLocales:
supportedLocales
,
debugShowMaterialGrid:
debugShowMaterialGrid
,
showPerformanceOverlay:
showPerformanceOverlay
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
,
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
)
:
MaterialApp
(
...
...
@@ -307,25 +289,23 @@ class GetMaterialApp extends StatelessWidget {
child:
builder
==
null
?
child
!
:
builder
!(
context
,
child
),
);
},
title:
title
??
''
,
title:
title
,
onGenerateTitle:
onGenerateTitle
,
color:
color
,
theme:
_
.
theme
??
theme
??
ThemeData
.
fallback
(),
darkTheme:
darkTheme
,
themeMode:
_
.
themeMode
??
themeMode
??
ThemeMode
.
system
,
themeMode:
_
.
themeMode
??
themeMode
,
locale:
Get
.
locale
??
locale
,
localizationsDelegates:
localizationsDelegates
,
localeListResolutionCallback:
localeListResolutionCallback
,
localeResolutionCallback:
localeResolutionCallback
,
supportedLocales:
supportedLocales
??
const
<
Locale
>[
Locale
(
'en'
,
'US'
)],
debugShowMaterialGrid:
debugShowMaterialGrid
??
false
,
showPerformanceOverlay:
showPerformanceOverlay
??
false
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
??
false
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
??
false
,
showSemanticsDebugger:
showSemanticsDebugger
??
false
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
??
true
,
supportedLocales:
supportedLocales
,
debugShowMaterialGrid:
debugShowMaterialGrid
,
showPerformanceOverlay:
showPerformanceOverlay
,
checkerboardRasterCacheImages:
checkerboardRasterCacheImages
,
checkerboardOffscreenLayers:
checkerboardOffscreenLayers
,
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
// actions: actions,
));
...
...
lib/get_navigation/src/root/parse_route.dart
View file @
abae891
import
'
../../../get_core/src/get_main.dart'
;
import
'
package:collection/collection.dart'
show
IterableExtension
;
import
'../../../get_core/src/get_main.dart'
;
import
'../../get_navigation.dart'
;
import
'../routes/get_route.dart'
;
import
'package:collection/collection.dart'
show
IterableExtension
;
class
RouteDecoder
{
final
GetPage
?
route
;
final
Map
<
String
?,
String
>
parameters
;
final
Map
<
String
,
String
?
>
parameters
;
const
RouteDecoder
(
this
.
route
,
this
.
parameters
);
}
...
...
@@ -16,10 +16,10 @@ class ParseRouteTree {
RouteDecoder
matchRoute
(
String
name
)
{
final
uri
=
Uri
.
parse
(
name
);
final
route
=
_findRoute
(
uri
.
path
);
final
params
=
Map
<
String
?,
String
>.
from
(
uri
.
queryParameters
);
final
params
=
Map
<
String
,
String
?
>.
from
(
uri
.
queryParameters
);
if
(
route
!=
null
)
{
final
parsedParams
=
_parseParams
(
name
,
route
.
path
);
if
(
parsedParams
!=
null
&&
parsedParams
.
isNotEmpty
)
{
if
(
parsedParams
.
isNotEmpty
)
{
params
.
addAll
(
parsedParams
);
}
}
else
{
...
...
@@ -95,13 +95,13 @@ class ParseRouteTree {
);
}
Map
<
String
?,
String
>
_parseParams
(
String
path
,
PathDecoded
routePath
)
{
final
params
=
<
String
?,
String
>{};
Map
<
String
,
String
?>
_parseParams
(
String
path
,
PathDecoded
routePath
)
{
final
params
=
<
String
,
String
?>{};
Match
?
paramsMatch
=
routePath
.
regex
.
firstMatch
(
path
);
for
(
var
i
=
0
;
i
<
routePath
.
keys
.
length
;
i
++)
{
var
param
=
Uri
.
decodeQueryComponent
(
paramsMatch
![
i
+
1
]!);
params
[
routePath
.
keys
[
i
]]
=
param
;
params
[
routePath
.
keys
[
i
]
!
]
=
param
;
}
return
params
;
}
...
...
lib/get_navigation/src/root/root_controller.dart
View file @
abae891
...
...
@@ -25,9 +25,9 @@ class GetMaterialController extends GetxController {
final
routing
=
Routing
();
Map
<
String
?,
String
>
parameters
=
{};
Map
<
String
,
String
?
>
parameters
=
{};
ParseRouteTree
?
routeTree
;
late
ParseRouteTree
routeTree
;
CustomTransition
?
customTransition
;
...
...
lib/get_navigation/src/routes/default_route.dart
View file @
abae891
...
...
@@ -416,7 +416,7 @@ class _CupertinoBackGestureDetector<T> extends StatefulWidget {
required
this
.
enabledCallback
,
required
this
.
onStartPopGesture
,
required
this
.
child
,
})
:
assert
(
enabledCallback
!=
null
),
})
:
assert
(
enabledCallback
!=
null
),
assert
(
onStartPopGesture
!=
null
),
assert
(
child
!=
null
),
super
(
key:
key
);
...
...
@@ -493,11 +493,9 @@ class _CupertinoBackGestureDetectorState<T>
return
-
value
;
case
TextDirection
.
ltr
:
return
value
;
default
:
return
value
;
}
// FIXME: shouldn't we return a default here?
// or perhaps throw error
// ignore: avoid_returning_null
return
null
;
}
@override
...
...
@@ -535,7 +533,7 @@ class _CupertinoBackGestureController<T> {
_CupertinoBackGestureController
({
required
this
.
navigator
,
required
this
.
controller
,
})
:
assert
(
navigator
!=
null
),
})
:
assert
(
navigator
!=
null
),
assert
(
controller
!=
null
)
{
navigator
.
didStartUserGesture
();
}
...
...
@@ -579,7 +577,8 @@ class _CupertinoBackGestureController<T> {
_kMaxDroppedSwipePageForwardAnimationTime
,
0
,
controller
.
value
,
)!.
floor
(),
)!
.
floor
(),
_kMaxPageBackAnimationTime
,
);
controller
.
animateTo
(
1.0
,
...
...
@@ -597,7 +596,8 @@ class _CupertinoBackGestureController<T> {
0
,
_kMaxDroppedSwipePageForwardAnimationTime
,
controller
.
value
,
)!.
floor
();
)!
.
floor
();
controller
.
animateBack
(
0.0
,
duration:
Duration
(
milliseconds:
droppedPageBackAnimationTime
),
...
...
Please
register
or
login
to post a comment