kawal7415

some code reduction

... ... @@ -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();
... ...
... ... @@ -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");
... ...
... ... @@ -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;
}
}
... ...