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
kawal7415
2020-09-09 13:54:41 +0530
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
75fadfe8c0d97a0887f986bbbf2acde1f777d56e
75fadfe8
1 parent
c2913450
some code reduction
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
27 deletions
lib/src/navigation/routes/default_route.dart
lib/src/navigation/routes/observers/route_observer.dart
lib/src/navigation/snackbar/snack_route.dart
lib/src/navigation/routes/default_route.dart
View file @
75fadfe
...
...
@@ -85,21 +85,14 @@ class GetPageRoute<T> extends PageRoute<T> {
}
static
bool
_isPopGestureEnabled
<
T
>(
PageRoute
<
T
>
route
)
{
if
(
route
.
isFirst
)
return
false
;
if
(
route
.
willHandlePopInternally
)
return
false
;
if
(
route
.
hasScopedWillPopCallback
)
return
false
;
if
(
route
.
fullscreenDialog
)
return
false
;
if
(
route
.
animation
.
status
!=
AnimationStatus
.
completed
)
return
false
;
if
(
route
.
secondaryAnimation
.
status
!=
AnimationStatus
.
dismissed
)
{
return
false
;
}
if
(
isPopGestureInProgress
(
route
))
return
false
;
// ignore: lines_longer_than_80_chars
if
(
route
.
isFirst
||
route
.
willHandlePopInternally
||
route
.
hasScopedWillPopCallback
||
route
.
fullscreenDialog
||
route
.
animation
.
status
!=
AnimationStatus
.
completed
||
route
.
secondaryAnimation
.
status
!=
AnimationStatus
.
dismissed
||
isPopGestureInProgress
(
route
))
return
false
;
return
true
;
}
...
...
@@ -120,9 +113,7 @@ class GetPageRoute<T> extends PageRoute<T> {
Animation
<
double
>
animation
,
Animation
<
double
>
secondaryAnimation
,
)
{
if
(
binding
!=
null
)
{
binding
.
dependencies
();
}
binding
?.
dependencies
();
if
(
bindings
!=
null
)
{
for
(
final
binding
in
bindings
)
{
binding
.
dependencies
();
...
...
lib/src/navigation/routes/observers/route_observer.dart
View file @
75fadfe
...
...
@@ -55,7 +55,7 @@ class GetObserver extends NavigatorObserver {
String
name
(
Route
<
dynamic
>
route
)
{
if
(
route
?.
settings
?.
name
!=
null
)
{
return
route
?.
settings
?
.
name
;
return
route
.
settings
.
name
;
}
else
if
(
route
is
GetPageRoute
)
{
return
route
.
routeName
;
}
else
if
(
route
is
GetDialogRoute
)
{
...
...
@@ -77,9 +77,7 @@ class GetObserver extends NavigatorObserver {
if
(
isSnackbar
)
{
GetConfig
.
log
(
"OPEN SNACKBAR
$routeName
"
);
}
else
if
(
isBottomSheet
)
{
GetConfig
.
log
(
"OPEN
$routeName
"
);
}
else
if
(
isDialog
)
{
}
else
if
(
isBottomSheet
||
isDialog
)
{
GetConfig
.
log
(
"OPEN
$routeName
"
);
}
else
if
(
isGetPageRoute
)
{
GetConfig
.
log
(
"GOING TO ROUTE
$routeName
"
);
...
...
@@ -112,9 +110,7 @@ class GetObserver extends NavigatorObserver {
if
(
isSnackbar
)
{
GetConfig
.
log
(
"CLOSE SNACKBAR
$routeName
"
);
}
else
if
(
isBottomSheet
)
{
GetConfig
.
log
(
"CLOSE
$routeName
"
);
}
else
if
(
isDialog
)
{
}
else
if
(
isBottomSheet
||
isDialog
)
{
GetConfig
.
log
(
"CLOSE
$routeName
"
);
}
else
if
(
isGetPageRoute
)
{
GetConfig
.
log
(
"CLOSE TO ROUTE
$routeName
"
);
...
...
lib/src/navigation/snackbar/snack_route.dart
View file @
75fadfe
...
...
@@ -154,9 +154,8 @@ class SnackRoute<T> extends OverlayRoute<T> {
}
else
{
if
(
snack
.
snackPosition
==
SnackPosition
.
TOP
)
{
return
DismissDirection
.
up
;
}
else
{
return
DismissDirection
.
down
;
}
return
DismissDirection
.
down
;
}
}
...
...
Please
register
or
login
to post a comment