Nicolas Lopez

Navigation Generic && Arguments

@@ -220,7 +220,7 @@ extension ExtensionDialog on GetInterface { @@ -220,7 +220,7 @@ extension ExtensionDialog on GetInterface {
220 Color barrierColor, 220 Color barrierColor,
221 bool useSafeArea = true, 221 bool useSafeArea = true,
222 bool useRootNavigator = true, 222 bool useRootNavigator = true,
223 - RouteSettings routeSettings, 223 + Object arguments,
224 Duration transitionDuration, 224 Duration transitionDuration,
225 Curve transitionCurve, 225 Curve transitionCurve,
226 }) { 226 }) {
@@ -231,7 +231,7 @@ extension ExtensionDialog on GetInterface { @@ -231,7 +231,7 @@ extension ExtensionDialog on GetInterface {
231 assert(debugCheckHasMaterialLocalizations(context)); 231 assert(debugCheckHasMaterialLocalizations(context));
232 232
233 final theme = Theme.of(context, shadowThemeOnly: true); 233 final theme = Theme.of(context, shadowThemeOnly: true);
234 - return generalDialog( 234 + return generalDialog<T>(
235 pageBuilder: (buildContext, animation, secondaryAnimation) { 235 pageBuilder: (buildContext, animation, secondaryAnimation) {
236 final pageChild = widget; 236 final pageChild = widget;
237 Widget dialog = Builder(builder: (context) { 237 Widget dialog = Builder(builder: (context) {
@@ -258,7 +258,7 @@ extension ExtensionDialog on GetInterface { @@ -258,7 +258,7 @@ extension ExtensionDialog on GetInterface {
258 ); 258 );
259 }, 259 },
260 useRootNavigator: useRootNavigator, 260 useRootNavigator: useRootNavigator,
261 - routeSettings: routeSettings, 261 + routeSettings: RouteSettings(arguments: arguments),
262 ); 262 );
263 } 263 }
264 264
@@ -360,7 +360,7 @@ extension ExtensionDialog on GetInterface { @@ -360,7 +360,7 @@ extension ExtensionDialog on GetInterface {
360 } 360 }
361 } 361 }
362 362
363 - return dialog( 363 + return dialog<T>(
364 AlertDialog( 364 AlertDialog(
365 titlePadding: EdgeInsets.all(8), 365 titlePadding: EdgeInsets.all(8),
366 contentPadding: EdgeInsets.all(8), 366 contentPadding: EdgeInsets.all(8),
@@ -485,7 +485,7 @@ extension GetNavigation on GetInterface { @@ -485,7 +485,7 @@ extension GetNavigation on GetInterface {
485 return null; 485 return null;
486 } 486 }
487 return global(id)?.currentState?.push( 487 return global(id)?.currentState?.push(
488 - GetPageRoute( 488 + GetPageRoute<T>(
489 opaque: opaque ?? true, 489 opaque: opaque ?? true,
490 page: () => page, 490 page: () => page,
491 routeName: routeName, 491 routeName: routeName,
@@ -528,7 +528,7 @@ extension GetNavigation on GetInterface { @@ -528,7 +528,7 @@ extension GetNavigation on GetInterface {
528 if (preventDuplicates && page == currentRoute) { 528 if (preventDuplicates && page == currentRoute) {
529 return null; 529 return null;
530 } 530 }
531 - return global(id)?.currentState?.pushNamed(page, arguments: arguments); 531 + return global(id)?.currentState?.pushNamed<T>(page, arguments: arguments);
532 } 532 }
533 533
534 /// **Navigation.pushReplacementNamed()** shortcut.<br><br> 534 /// **Navigation.pushReplacementNamed()** shortcut.<br><br>
@@ -601,7 +601,7 @@ extension GetNavigation on GetInterface { @@ -601,7 +601,7 @@ extension GetNavigation on GetInterface {
601 Future<T> offUntil<T>(Route<T> page, RoutePredicate predicate, {int id}) { 601 Future<T> offUntil<T>(Route<T> page, RoutePredicate predicate, {int id}) {
602 // if (key.currentState.mounted) // add this if appear problems on future with route navigate 602 // if (key.currentState.mounted) // add this if appear problems on future with route navigate
603 // when widget don't mounted 603 // when widget don't mounted
604 - return global(id)?.currentState?.pushAndRemoveUntil(page, predicate); 604 + return global(id)?.currentState?.pushAndRemoveUntil<T>(page, predicate);
605 } 605 }
606 606
607 /// **Navigation.pushNamedAndRemoveUntil()** shortcut.<br><br> 607 /// **Navigation.pushNamedAndRemoveUntil()** shortcut.<br><br>
@@ -629,7 +629,7 @@ extension GetNavigation on GetInterface { @@ -629,7 +629,7 @@ extension GetNavigation on GetInterface {
629 }) { 629 }) {
630 return global(id) 630 return global(id)
631 ?.currentState 631 ?.currentState
632 - ?.pushNamedAndRemoveUntil(page, predicate, arguments: arguments); 632 + ?.pushNamedAndRemoveUntil<T>(page, predicate, arguments: arguments);
633 } 633 }
634 634
635 /// **Navigation.popAndPushNamed()** shortcut.<br><br> 635 /// **Navigation.popAndPushNamed()** shortcut.<br><br>
@@ -717,8 +717,8 @@ extension GetNavigation on GetInterface { @@ -717,8 +717,8 @@ extension GetNavigation on GetInterface {
717 /// 717 ///
718 /// It has the advantage of not needing context, so you can call 718 /// It has the advantage of not needing context, so you can call
719 /// from your business logic. 719 /// from your business logic.
720 - void back({  
721 - dynamic result, 720 + void back<T>({
  721 + T result,
722 bool closeOverlays = false, 722 bool closeOverlays = false,
723 bool canPop = true, 723 bool canPop = true,
724 int id, 724 int id,
@@ -733,7 +733,7 @@ extension GetNavigation on GetInterface { @@ -733,7 +733,7 @@ extension GetNavigation on GetInterface {
733 global(id)?.currentState?.pop(result); 733 global(id)?.currentState?.pop(result);
734 } 734 }
735 } else { 735 } else {
736 - global(id)?.currentState?.pop(result); 736 + global(id)?.currentState?.pop<T>(result);
737 } 737 }
738 } 738 }
739 739
@@ -854,7 +854,7 @@ extension GetNavigation on GetInterface { @@ -854,7 +854,7 @@ extension GetNavigation on GetInterface {
854 }) { 854 }) {
855 var routeName = "/${page.runtimeType.toString()}"; 855 var routeName = "/${page.runtimeType.toString()}";
856 856
857 - return global(id)?.currentState?.pushAndRemoveUntil( 857 + return global(id)?.currentState?.pushAndRemoveUntil<T>(
858 GetPageRoute( 858 GetPageRoute(
859 opaque: opaque ?? true, 859 opaque: opaque ?? true,
860 popGesture: popGesture ?? defaultPopGesture, 860 popGesture: popGesture ?? defaultPopGesture,