Jonny Borges
Committed by GitHub

Update extension_navigation.dart

@@ -1054,6 +1054,19 @@ you can only use widgets and widget functions here'''; @@ -1054,6 +1054,19 @@ you can only use widgets and widget functions here''';
1054 1054
1055 return _key; 1055 return _key;
1056 } 1056 }
  1057 +
  1058 + /// Casts the stored router delegate to a desired type
  1059 + TDelegate? delegate<TDelegate extends RouterDelegate<TPage>, TPage>() =>
  1060 + _routerDelegate as TDelegate?;
  1061 +
  1062 + static RouterDelegate? _routerDelegate;
  1063 +
  1064 + // ignore: use_setters_to_change_properties
  1065 + void setDefaultDelegate(RouterDelegate? delegate) {
  1066 + _routerDelegate = delegate;
  1067 + }
  1068 +
  1069 + GetDelegate? getDelegate() => delegate<GetDelegate, GetNavConfig>();
1057 1070
1058 /// give current arguments 1071 /// give current arguments
1059 dynamic get arguments => routing.args; 1072 dynamic get arguments => routing.args;