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-12-12 20:13:46 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9dac45f720fab3bf91f7be6a1ca5c6f1c011a9a9
9dac45f7
1 parent
788e8833
use inheritedMediaQuery
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
77 deletions
.DS_Store
lib/get_navigation/src/root/get_cupertino_app.dart
lib/get_navigation/src/root/get_material_app.dart
.DS_Store
View file @
9dac45f
No preview for this file type
lib/get_navigation/src/root/get_cupertino_app.dart
View file @
9dac45f
import
'package:flutter/cupertino.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
import
'../../../get_core/get_core.dart'
;
import
'../../../get_instance/get_instance.dart'
;
import
'../../../get_state_manager/get_state_manager.dart'
;
...
...
@@ -9,6 +10,59 @@ import '../../get_navigation.dart';
import
'root_controller.dart'
;
class
GetCupertinoApp
extends
StatelessWidget
{
final
GlobalKey
<
NavigatorState
>?
navigatorKey
;
final
Widget
?
home
;
final
Map
<
String
,
WidgetBuilder
>?
routes
;
final
String
?
initialRoute
;
final
RouteFactory
?
onGenerateRoute
;
final
InitialRouteListFactory
?
onGenerateInitialRoutes
;
final
RouteFactory
?
onUnknownRoute
;
final
List
<
NavigatorObserver
>?
navigatorObservers
;
final
TransitionBuilder
?
builder
;
final
String
title
;
final
GenerateAppTitle
?
onGenerateTitle
;
final
CustomTransition
?
customTransition
;
final
Color
?
color
;
final
Map
<
String
,
Map
<
String
,
String
>>?
translationsKeys
;
final
Translations
?
translations
;
final
TextDirection
?
textDirection
;
final
Locale
?
locale
;
final
Locale
?
fallbackLocale
;
final
Iterable
<
LocalizationsDelegate
<
dynamic
>>?
localizationsDelegates
;
final
LocaleListResolutionCallback
?
localeListResolutionCallback
;
final
LocaleResolutionCallback
?
localeResolutionCallback
;
final
Iterable
<
Locale
>
supportedLocales
;
final
bool
showPerformanceOverlay
;
final
bool
checkerboardRasterCacheImages
;
final
bool
checkerboardOffscreenLayers
;
final
bool
showSemanticsDebugger
;
final
bool
debugShowCheckedModeBanner
;
final
Map
<
LogicalKeySet
,
Intent
>?
shortcuts
;
final
ThemeData
?
highContrastTheme
;
final
ThemeData
?
highContrastDarkTheme
;
final
Map
<
Type
,
Action
<
Intent
>>?
actions
;
final
Function
(
Routing
?)?
routingCallback
;
final
Transition
?
defaultTransition
;
final
bool
?
opaqueRoute
;
final
VoidCallback
?
onInit
;
final
VoidCallback
?
onReady
;
final
VoidCallback
?
onDispose
;
final
bool
?
enableLog
;
final
LogWriterCallback
?
logWriterCallback
;
final
bool
?
popGesture
;
final
SmartManagement
smartManagement
;
final
Bindings
?
initialBinding
;
final
Duration
?
transitionDuration
;
final
bool
?
defaultGlobalState
;
final
List
<
GetPage
>?
getPages
;
final
GetPage
?
unknownRoute
;
final
RouteInformationProvider
?
routeInformationProvider
;
final
RouteInformationParser
<
Object
>?
routeInformationParser
;
final
RouterDelegate
<
Object
>?
routerDelegate
;
final
BackButtonDispatcher
?
backButtonDispatcher
;
final
CupertinoThemeData
?
theme
;
final
bool
useInheritedMediaQuery
;
const
GetCupertinoApp
({
Key
?
key
,
this
.
theme
,
...
...
@@ -46,6 +100,7 @@ class GetCupertinoApp extends StatelessWidget {
this
.
shortcuts
,
this
.
smartManagement
=
SmartManagement
.
full
,
this
.
initialBinding
,
this
.
useInheritedMediaQuery
=
false
,
this
.
unknownRoute
,
this
.
routingCallback
,
this
.
defaultTransition
,
...
...
@@ -66,58 +121,6 @@ class GetCupertinoApp extends StatelessWidget {
backButtonDispatcher
=
null
,
super
(
key:
key
);
final
GlobalKey
<
NavigatorState
>?
navigatorKey
;
final
Widget
?
home
;
final
Map
<
String
,
WidgetBuilder
>?
routes
;
final
String
?
initialRoute
;
final
RouteFactory
?
onGenerateRoute
;
final
InitialRouteListFactory
?
onGenerateInitialRoutes
;
final
RouteFactory
?
onUnknownRoute
;
final
List
<
NavigatorObserver
>?
navigatorObservers
;
final
TransitionBuilder
?
builder
;
final
String
title
;
final
GenerateAppTitle
?
onGenerateTitle
;
final
CustomTransition
?
customTransition
;
final
Color
?
color
;
final
Map
<
String
,
Map
<
String
,
String
>>?
translationsKeys
;
final
Translations
?
translations
;
final
TextDirection
?
textDirection
;
final
Locale
?
locale
;
final
Locale
?
fallbackLocale
;
final
Iterable
<
LocalizationsDelegate
<
dynamic
>>?
localizationsDelegates
;
final
LocaleListResolutionCallback
?
localeListResolutionCallback
;
final
LocaleResolutionCallback
?
localeResolutionCallback
;
final
Iterable
<
Locale
>
supportedLocales
;
final
bool
showPerformanceOverlay
;
final
bool
checkerboardRasterCacheImages
;
final
bool
checkerboardOffscreenLayers
;
final
bool
showSemanticsDebugger
;
final
bool
debugShowCheckedModeBanner
;
final
Map
<
LogicalKeySet
,
Intent
>?
shortcuts
;
final
ThemeData
?
highContrastTheme
;
final
ThemeData
?
highContrastDarkTheme
;
final
Map
<
Type
,
Action
<
Intent
>>?
actions
;
final
Function
(
Routing
?)?
routingCallback
;
final
Transition
?
defaultTransition
;
final
bool
?
opaqueRoute
;
final
VoidCallback
?
onInit
;
final
VoidCallback
?
onReady
;
final
VoidCallback
?
onDispose
;
final
bool
?
enableLog
;
final
LogWriterCallback
?
logWriterCallback
;
final
bool
?
popGesture
;
final
SmartManagement
smartManagement
;
final
Bindings
?
initialBinding
;
final
Duration
?
transitionDuration
;
final
bool
?
defaultGlobalState
;
final
List
<
GetPage
>?
getPages
;
final
GetPage
?
unknownRoute
;
final
RouteInformationProvider
?
routeInformationProvider
;
final
RouteInformationParser
<
Object
>?
routeInformationParser
;
final
RouterDelegate
<
Object
>?
routerDelegate
;
final
BackButtonDispatcher
?
backButtonDispatcher
;
final
CupertinoThemeData
?
theme
;
GetCupertinoApp
.
router
({
Key
?
key
,
this
.
theme
,
...
...
@@ -128,6 +131,7 @@ class GetCupertinoApp extends StatelessWidget {
this
.
builder
,
this
.
title
=
''
,
this
.
onGenerateTitle
,
this
.
useInheritedMediaQuery
=
false
,
this
.
color
,
this
.
highContrastTheme
,
this
.
highContrastDarkTheme
,
...
...
@@ -183,31 +187,6 @@ class GetCupertinoApp extends StatelessWidget {
Get
.
routeInformationParser
=
routeInformationParser
;
}
Route
<
dynamic
>
generator
(
RouteSettings
settings
)
{
return
PageRedirect
(
settings:
settings
,
unknownRoute:
unknownRoute
).
page
();
}
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
{
return
[
PageRedirect
(
settings:
RouteSettings
(
name:
name
),
unknownRoute:
unknownRoute
,
).
page
()
];
}
Widget
defaultBuilder
(
BuildContext
context
,
Widget
?
child
)
{
return
Directionality
(
textDirection:
textDirection
??
(
rtlLanguages
.
contains
(
Get
.
locale
?.
languageCode
)
?
TextDirection
.
rtl
:
TextDirection
.
ltr
),
child:
builder
==
null
?
(
child
??
Material
())
:
builder
!(
context
,
child
??
Material
()),
);
}
@override
Widget
build
(
BuildContext
context
)
=>
GetBuilder
<
GetMaterialController
>(
init:
Get
.
rootController
,
...
...
@@ -271,6 +250,7 @@ class GetCupertinoApp extends StatelessWidget {
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
useInheritedMediaQuery:
useInheritedMediaQuery
,
)
:
CupertinoApp
(
key:
_
.
unikey
,
...
...
@@ -310,7 +290,33 @@ class GetCupertinoApp extends StatelessWidget {
showSemanticsDebugger:
showSemanticsDebugger
,
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
useInheritedMediaQuery:
useInheritedMediaQuery
,
// actions: actions,
),
);
Widget
defaultBuilder
(
BuildContext
context
,
Widget
?
child
)
{
return
Directionality
(
textDirection:
textDirection
??
(
rtlLanguages
.
contains
(
Get
.
locale
?.
languageCode
)
?
TextDirection
.
rtl
:
TextDirection
.
ltr
),
child:
builder
==
null
?
(
child
??
Material
())
:
builder
!(
context
,
child
??
Material
()),
);
}
Route
<
dynamic
>
generator
(
RouteSettings
settings
)
{
return
PageRedirect
(
settings:
settings
,
unknownRoute:
unknownRoute
).
page
();
}
List
<
Route
<
dynamic
>>
initialRoutesGenerate
(
String
name
)
{
return
[
PageRedirect
(
settings:
RouteSettings
(
name:
name
),
unknownRoute:
unknownRoute
,
).
page
()
];
}
}
...
...
lib/get_navigation/src/root/get_material_app.dart
View file @
9dac45f
...
...
@@ -67,6 +67,7 @@ class GetMaterialApp extends StatelessWidget {
final
RouteInformationParser
<
Object
>?
routeInformationParser
;
final
RouterDelegate
<
Object
>?
routerDelegate
;
final
BackButtonDispatcher
?
backButtonDispatcher
;
final
bool
useInheritedMediaQuery
;
const
GetMaterialApp
({
Key
?
key
,
this
.
navigatorKey
,
...
...
@@ -78,6 +79,7 @@ class GetMaterialApp extends StatelessWidget {
this
.
onGenerateRoute
,
this
.
onGenerateInitialRoutes
,
this
.
onUnknownRoute
,
this
.
useInheritedMediaQuery
=
false
,
List
<
NavigatorObserver
>
this
.
navigatorObservers
=
const
<
NavigatorObserver
>[],
this
.
builder
,
...
...
@@ -142,6 +144,7 @@ class GetMaterialApp extends StatelessWidget {
this
.
color
,
this
.
theme
,
this
.
darkTheme
,
this
.
useInheritedMediaQuery
=
false
,
this
.
highContrastTheme
,
this
.
highContrastDarkTheme
,
this
.
themeMode
=
ThemeMode
.
system
,
...
...
@@ -271,6 +274,7 @@ class GetMaterialApp extends StatelessWidget {
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
scrollBehavior:
scrollBehavior
,
useInheritedMediaQuery:
useInheritedMediaQuery
,
)
:
MaterialApp
(
key:
_
.
unikey
,
...
...
@@ -317,6 +321,7 @@ class GetMaterialApp extends StatelessWidget {
debugShowCheckedModeBanner:
debugShowCheckedModeBanner
,
shortcuts:
shortcuts
,
scrollBehavior:
scrollBehavior
,
useInheritedMediaQuery:
useInheritedMediaQuery
,
// actions: actions,
),
);
...
...
Please
register
or
login
to post a comment