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
Jonatas
2020-08-23 08:49:40 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
422c906167444b1579fb2e88c73bc570e366870f
422c9061
1 parent
6b49d093
added hideUrl function
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
lib/src/core/get_interface.dart
lib/src/navigation/extension_navigation.dart
lib/src/navigation/root/root_widget.dart
lib/src/core/get_interface.dart
View file @
422c906
...
...
@@ -16,6 +16,7 @@ import '../../utils.dart';
abstract
class
GetInterface
{
bool
defaultPopGesture
=
GetPlatform
.
isIOS
;
bool
defaultOpaqueRoute
=
true
;
bool
forceRouteName
=
true
;
Transition
defaultTransition
;
Duration
defaultDurationTransition
=
Duration
(
milliseconds:
400
);
bool
defaultGlobalState
=
true
;
...
...
lib/src/navigation/extension_navigation.dart
View file @
422c906
...
...
@@ -43,10 +43,12 @@ extension GetNavigation on GetInterface {
bool
fullscreenDialog
=
false
,
Object
arguments
,
Bindings
binding
,
preventDuplicates
=
true
,
bool
preventDuplicates
=
true
,
bool
popGesture
,
})
{
if
(
preventDuplicates
&&
'/
${page.runtimeType}
'
==
currentRoute
)
{
if
(
preventDuplicates
&&
'/
${page.runtimeType}
'
==
currentRoute
&&
forceRouteName
)
{
return
null
;
}
return
global
(
id
).
currentState
.
push
(
...
...
@@ -54,7 +56,7 @@ extension GetNavigation on GetInterface {
opaque:
opaque
??
true
,
page:
()
=>
page
,
settings:
RouteSettings
(
name:
'/
${page.runtimeType}
'
,
name:
forceRouteName
?
'/
${page.runtimeType}
'
:
'
'
,
arguments:
arguments
,
),
popGesture:
popGesture
??
defaultPopGesture
,
...
...
@@ -318,15 +320,18 @@ extension GetNavigation on GetInterface {
preventDuplicates
=
true
,
Duration
duration
,
})
{
if
(
preventDuplicates
&&
'/
${page.runtimeType}
'
==
currentRoute
)
{
if
(
preventDuplicates
&&
'/
${page.runtimeType}
'
==
currentRoute
&&
forceRouteName
)
{
return
null
;
}
return
global
(
id
).
currentState
.
pushReplacement
(
GetPageRoute
(
opaque:
opaque
??
true
,
page:
()
=>
page
,
binding:
binding
,
settings:
RouteSettings
(
name:
'/
${page.runtimeType}
'
,
arguments:
arguments
),
settings:
RouteSettings
(
name:
forceRouteName
?
'/
${page.runtimeType}
'
:
''
,
arguments:
arguments
),
fullscreenDialog:
fullscreenDialog
,
popGesture:
popGesture
??
defaultPopGesture
,
transition:
transition
??
defaultTransition
,
...
...
@@ -381,8 +386,9 @@ extension GetNavigation on GetInterface {
popGesture:
popGesture
??
defaultPopGesture
,
page:
()
=>
page
,
binding:
binding
,
settings:
RouteSettings
(
name:
'/
${page.runtimeType}
'
,
arguments:
arguments
),
settings:
RouteSettings
(
name:
forceRouteName
?
'/
${page.runtimeType}
'
:
''
,
arguments:
arguments
),
fullscreenDialog:
fullscreenDialog
,
transition:
transition
??
defaultTransition
,
transitionDuration:
duration
??
defaultDurationTransition
,
...
...
lib/src/navigation/root/root_widget.dart
View file @
422c906
...
...
@@ -50,6 +50,7 @@ class GetMaterialApp extends StatelessWidget {
this
.
defaultTransition
,
// this.actions,
this
.
getPages
,
this
.
forceRouteName
=
true
,
this
.
opaqueRoute
,
this
.
enableLog
,
this
.
logWriterCallback
,
...
...
@@ -102,6 +103,7 @@ class GetMaterialApp extends StatelessWidget {
final
Function
(
Routing
)
routingCallback
;
final
Transition
defaultTransition
;
final
bool
opaqueRoute
;
final
bool
forceRouteName
;
final
VoidCallback
onInit
;
final
VoidCallback
onDispose
;
final
bool
enableLog
;
...
...
@@ -189,6 +191,8 @@ class GetMaterialApp extends StatelessWidget {
if
(
fallbackLocale
!=
null
)
Get
.
fallbackLocale
=
fallbackLocale
;
Get
.
forceRouteName
=
forceRouteName
;
if
(
translations
!=
null
)
{
Get
.
translations
=
translations
.
keys
;
}
else
if
(
translationsKeys
!=
null
)
{
...
...
@@ -261,7 +265,6 @@ abstract class Translations {
Map
<
String
,
Map
<
String
,
String
>>
get
keys
;
}
extension
Trans
on
String
{
String
get
tr
{
// Returns the key if locale is null.
...
...
Please
register
or
login
to post a comment