Showing
8 changed files
with
125 additions
and
86 deletions
| 1 | +## [2.0.10] | ||
| 2 | +- Bump new Flutter version | ||
| 3 | +- Added Get.generalDialog | ||
| 4 | + | ||
| 5 | +## [2.0.6] | ||
| 6 | +- Fix typo on readme | ||
| 7 | + | ||
| 8 | +## [2.0.5] | ||
| 9 | +- Changing the bottomsheet API to comply with the documentation. | ||
| 10 | + | ||
| 11 | +## [2.0.4] | ||
| 12 | +- Fix type not found in some versions of Flutter stable | ||
| 13 | + | ||
| 1 | ## [2.0.3] | 14 | ## [2.0.3] |
| 2 | - Update Docs | 15 | - Update Docs |
| 3 | 16 |
| @@ -24,11 +24,12 @@ This library that will change the way you work with the Framework and save your | @@ -24,11 +24,12 @@ This library that will change the way you work with the Framework and save your | ||
| 24 | 24 | ||
| 25 | ## How to use? | 25 | ## How to use? |
| 26 | 26 | ||
| 27 | -- Flutter Master/Dev/Beta: version 2.0.x-dev | 27 | +<!-- - Flutter Master/Dev/Beta: version 2.0.x-dev |
| 28 | - Flutter Stable branch: version 2.0.x | 28 | - Flutter Stable branch: version 2.0.x |
| 29 | -(look for latest version on pub.dev) | 29 | +(look for latest version on pub.dev) --> |
| 30 | 30 | ||
| 31 | -Add Get to your pubspec.yaml file according to the version of Flutter you are using. | 31 | +Add Get to your pubspec.yaml file |
| 32 | +<!-- according to the version of Flutter you are using. --> | ||
| 32 | 33 | ||
| 33 | Exchange your MaterialApp for GetMaterialApp and enjoy! | 34 | Exchange your MaterialApp for GetMaterialApp and enjoy! |
| 34 | ```dart | 35 | ```dart |
| @@ -103,7 +104,7 @@ navigator.push( | @@ -103,7 +104,7 @@ navigator.push( | ||
| 103 | ), | 104 | ), |
| 104 | ); | 105 | ); |
| 105 | 106 | ||
| 106 | -// Get syntax (It is much better, but you have the right to disagree) | 107 | +// Get sintax (It is much better, but you have the right to disagree) |
| 107 | Get.to(HomePage()); | 108 | Get.to(HomePage()); |
| 108 | 109 | ||
| 109 | 110 | ||
| @@ -206,6 +207,11 @@ To open default dialog: | @@ -206,6 +207,11 @@ To open default dialog: | ||
| 206 | onPressed: () => Get.back(), | 207 | onPressed: () => Get.back(), |
| 207 | )); | 208 | )); |
| 208 | ``` | 209 | ``` |
| 210 | +You can also use Get.generalDialog instead of showGeneralDialog. | ||
| 211 | + | ||
| 212 | +For all other Flutter dialog widgets, including cupertinos, you can use Get.overlayContext instead of context, and open it anywhere in your code. | ||
| 213 | +For widgets that don't use Overlay, you can use Get.context. | ||
| 214 | +These two contexts will work in 99% of cases to replace the context of your UI, except for cases where inheritedWidget is used without a navigation context. | ||
| 209 | 215 | ||
| 210 | ### BottomSheets | 216 | ### BottomSheets |
| 211 | Get.bottomSheet is like showModalBottomSheet, but don't need of context. | 217 | Get.bottomSheet is like showModalBottomSheet, but don't need of context. |
| @@ -480,6 +486,10 @@ void main() { | @@ -480,6 +486,10 @@ void main() { | ||
| 480 | initialRoute: '/', | 486 | initialRoute: '/', |
| 481 | namedRoutes: { | 487 | namedRoutes: { |
| 482 | '/': GetRoute(page: MyHomePage()), | 488 | '/': GetRoute(page: MyHomePage()), |
| 489 | + /// Important! :user is not a new route, it is just a parameter | ||
| 490 | + /// specification. Do not use '/second/:user' and '/second' | ||
| 491 | + /// if you need new route to user, use '/second/user/:user' | ||
| 492 | + /// if '/second' is a route. | ||
| 483 | '/second/:user': GetRoute(page: Second()), // receive ID | 493 | '/second/:user': GetRoute(page: Second()), // receive ID |
| 484 | '/third': GetRoute(page: Third(),transition: Transition.cupertino); | 494 | '/third': GetRoute(page: Third(),transition: Transition.cupertino); |
| 485 | }, | 495 | }, |
| @@ -194,12 +194,12 @@ class Get { | @@ -194,12 +194,12 @@ class Get { | ||
| 194 | Widget child, { | 194 | Widget child, { |
| 195 | bool barrierDismissible = true, | 195 | bool barrierDismissible = true, |
| 196 | bool useRootNavigator = true, | 196 | bool useRootNavigator = true, |
| 197 | - RouteSettings routeSettings, | 197 | + // RouteSettings routeSettings |
| 198 | }) { | 198 | }) { |
| 199 | return showDialog( | 199 | return showDialog( |
| 200 | barrierDismissible: barrierDismissible, | 200 | barrierDismissible: barrierDismissible, |
| 201 | useRootNavigator: useRootNavigator, | 201 | useRootNavigator: useRootNavigator, |
| 202 | - routeSettings: routeSettings, | 202 | + routeSettings: RouteSettings(name: 'dialog'), |
| 203 | context: overlayContext, | 203 | context: overlayContext, |
| 204 | builder: (_) { | 204 | builder: (_) { |
| 205 | return child; | 205 | return child; |
| @@ -207,6 +207,31 @@ class Get { | @@ -207,6 +207,31 @@ class Get { | ||
| 207 | ); | 207 | ); |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | + /// Api from showGeneralDialog with no context | ||
| 211 | + static Future<T> generalDialog<T>({ | ||
| 212 | + @required RoutePageBuilder pageBuilder, | ||
| 213 | + bool barrierDismissible, | ||
| 214 | + String barrierLabel, | ||
| 215 | + Color barrierColor, | ||
| 216 | + Duration transitionDuration, | ||
| 217 | + RouteTransitionsBuilder transitionBuilder, | ||
| 218 | + bool useRootNavigator = true, | ||
| 219 | + RouteSettings routeSettings, | ||
| 220 | + // RouteSettings routeSettings | ||
| 221 | + }) { | ||
| 222 | + return showGeneralDialog( | ||
| 223 | + pageBuilder: pageBuilder, | ||
| 224 | + barrierDismissible: barrierDismissible, | ||
| 225 | + barrierLabel: barrierLabel, | ||
| 226 | + barrierColor: barrierColor, | ||
| 227 | + transitionDuration: transitionDuration, | ||
| 228 | + transitionBuilder: transitionBuilder, | ||
| 229 | + useRootNavigator: useRootNavigator, | ||
| 230 | + routeSettings: RouteSettings(name: 'dialog'), | ||
| 231 | + context: overlayContext, | ||
| 232 | + ); | ||
| 233 | + } | ||
| 234 | + | ||
| 210 | static Future<T> defaultDialog<T>( | 235 | static Future<T> defaultDialog<T>( |
| 211 | {String title = "Alert dialog", | 236 | {String title = "Alert dialog", |
| 212 | Widget content, | 237 | Widget content, |
| @@ -219,8 +244,8 @@ class Get { | @@ -219,8 +244,8 @@ class Get { | ||
| 219 | )); | 244 | )); |
| 220 | } | 245 | } |
| 221 | 246 | ||
| 222 | - static Future<T> bottomSheet<T>({ | ||
| 223 | - @required WidgetBuilder builder, | 247 | + static Future<T> bottomSheet<T>( |
| 248 | + Widget bottomsheet, { | ||
| 224 | Color backgroundColor, | 249 | Color backgroundColor, |
| 225 | double elevation, | 250 | double elevation, |
| 226 | ShapeBorder shape, | 251 | ShapeBorder shape, |
| @@ -232,14 +257,14 @@ class Get { | @@ -232,14 +257,14 @@ class Get { | ||
| 232 | bool isDismissible = true, | 257 | bool isDismissible = true, |
| 233 | bool enableDrag = true, | 258 | bool enableDrag = true, |
| 234 | }) { | 259 | }) { |
| 235 | - assert(builder != null); | 260 | + assert(bottomsheet != null); |
| 236 | assert(isScrollControlled != null); | 261 | assert(isScrollControlled != null); |
| 237 | assert(useRootNavigator != null); | 262 | assert(useRootNavigator != null); |
| 238 | assert(isDismissible != null); | 263 | assert(isDismissible != null); |
| 239 | assert(enableDrag != null); | 264 | assert(enableDrag != null); |
| 240 | 265 | ||
| 241 | return navigator.push<T>(GetModalBottomSheetRoute<T>( | 266 | return navigator.push<T>(GetModalBottomSheetRoute<T>( |
| 242 | - builder: builder, | 267 | + builder: (_) => bottomsheet, |
| 243 | theme: Theme.of(Get.key.currentContext, shadowThemeOnly: true), | 268 | theme: Theme.of(Get.key.currentContext, shadowThemeOnly: true), |
| 244 | isScrollControlled: isScrollControlled, | 269 | isScrollControlled: isScrollControlled, |
| 245 | barrierLabel: MaterialLocalizations.of(Get.key.currentContext) | 270 | barrierLabel: MaterialLocalizations.of(Get.key.currentContext) |
| @@ -399,10 +424,16 @@ class Get { | @@ -399,10 +424,16 @@ class Get { | ||
| 399 | return _singl[T]; | 424 | return _singl[T]; |
| 400 | } | 425 | } |
| 401 | 426 | ||
| 427 | + static bool reset() { | ||
| 428 | + _singl.clear(); | ||
| 429 | + return true; | ||
| 430 | + } | ||
| 431 | + | ||
| 402 | /// Delete a singleton instance of your class | 432 | /// Delete a singleton instance of your class |
| 403 | static bool delete<T>(T singleton) { | 433 | static bool delete<T>(T singleton) { |
| 404 | if (!_singl.containsKey(T)) { | 434 | if (!_singl.containsKey(T)) { |
| 405 | - throw 'key id not found'; | 435 | + print('key id not found'); |
| 436 | + return false; | ||
| 406 | } | 437 | } |
| 407 | _singl.removeWhere((oldkey, value) => (oldkey == T)); | 438 | _singl.removeWhere((oldkey, value) => (oldkey == T)); |
| 408 | return true; | 439 | return true; |
| @@ -34,7 +34,7 @@ class GetMaterialApp extends StatefulWidget { | @@ -34,7 +34,7 @@ class GetMaterialApp extends StatefulWidget { | ||
| 34 | this.shortcuts, | 34 | this.shortcuts, |
| 35 | this.routingCallback, | 35 | this.routingCallback, |
| 36 | this.defaultTransition, | 36 | this.defaultTransition, |
| 37 | - this.actions, | 37 | + // this.actions, |
| 38 | this.opaqueRoute, | 38 | this.opaqueRoute, |
| 39 | this.enableLog, | 39 | this.enableLog, |
| 40 | this.popGesture, | 40 | this.popGesture, |
| @@ -79,7 +79,7 @@ class GetMaterialApp extends StatefulWidget { | @@ -79,7 +79,7 @@ class GetMaterialApp extends StatefulWidget { | ||
| 79 | final bool showSemanticsDebugger; | 79 | final bool showSemanticsDebugger; |
| 80 | final bool debugShowCheckedModeBanner; | 80 | final bool debugShowCheckedModeBanner; |
| 81 | final Map<LogicalKeySet, Intent> shortcuts; | 81 | final Map<LogicalKeySet, Intent> shortcuts; |
| 82 | - final Map<LocalKey, ActionFactory> actions; | 82 | + // final Map<LocalKey, ActionFactory> actions; |
| 83 | final bool debugShowMaterialGrid; | 83 | final bool debugShowMaterialGrid; |
| 84 | final Function(Routing) routingCallback; | 84 | final Function(Routing) routingCallback; |
| 85 | final Transition defaultTransition; | 85 | final Transition defaultTransition; |
| @@ -118,7 +118,15 @@ class _GetMaterialAppState extends State<GetMaterialApp> { | @@ -118,7 +118,15 @@ class _GetMaterialAppState extends State<GetMaterialApp> { | ||
| 118 | 118 | ||
| 119 | Route<dynamic> namedRoutesGenerate(RouteSettings settings) { | 119 | Route<dynamic> namedRoutesGenerate(RouteSettings settings) { |
| 120 | Get.setSettings(settings); | 120 | Get.setSettings(settings); |
| 121 | - final parsedString = parse.split(settings.name); | 121 | + // final parsedString = parse.split(settings.name); |
| 122 | + | ||
| 123 | + /// onGenerateRoute to FlutterWeb is Broken on Dev/Master. This is a temporary | ||
| 124 | + /// workaround until they fix it, because the problem is with the 'Flutter engine', | ||
| 125 | + /// which changes the initial route for an empty String, not the main Flutter, | ||
| 126 | + /// so only Team can fix it. | ||
| 127 | + final parsedString = parse.split( | ||
| 128 | + settings.name == '' ? (widget.initialRoute ?? '/') : settings.name); | ||
| 129 | + | ||
| 122 | String settingsname = parsedString.route; | 130 | String settingsname = parsedString.route; |
| 123 | Map<String, GetRoute> newNamedRoutes = {}; | 131 | Map<String, GetRoute> newNamedRoutes = {}; |
| 124 | 132 | ||
| @@ -196,7 +204,7 @@ class _GetMaterialAppState extends State<GetMaterialApp> { | @@ -196,7 +204,7 @@ class _GetMaterialAppState extends State<GetMaterialApp> { | ||
| 196 | showSemanticsDebugger: widget.showSemanticsDebugger ?? false, | 204 | showSemanticsDebugger: widget.showSemanticsDebugger ?? false, |
| 197 | debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner ?? true, | 205 | debugShowCheckedModeBanner: widget.debugShowCheckedModeBanner ?? true, |
| 198 | shortcuts: widget.shortcuts, | 206 | shortcuts: widget.shortcuts, |
| 199 | - actions: widget.actions, | 207 | + // actions: widget.actions, |
| 200 | ); | 208 | ); |
| 201 | } | 209 | } |
| 202 | } | 210 | } |
| @@ -29,7 +29,15 @@ class Routing { | @@ -29,7 +29,15 @@ class Routing { | ||
| 29 | 29 | ||
| 30 | class GetObserver extends NavigatorObserver { | 30 | class GetObserver extends NavigatorObserver { |
| 31 | final Function(Routing) routing; | 31 | final Function(Routing) routing; |
| 32 | + | ||
| 32 | GetObserver([this.routing]); | 33 | GetObserver([this.routing]); |
| 34 | + | ||
| 35 | + Route<dynamic> route; | ||
| 36 | + bool isBack; | ||
| 37 | + bool isSnackbar; | ||
| 38 | + bool isBottomSheet; | ||
| 39 | + bool isDialog; | ||
| 40 | + | ||
| 33 | @override | 41 | @override |
| 34 | void didPush(Route<dynamic> route, Route<dynamic> previousRoute) { | 42 | void didPush(Route<dynamic> route, Route<dynamic> previousRoute) { |
| 35 | if ('${route?.settings?.name}' == 'snackbar') { | 43 | if ('${route?.settings?.name}' == 'snackbar') { |
| @@ -42,6 +50,10 @@ class GetObserver extends NavigatorObserver { | @@ -42,6 +50,10 @@ class GetObserver extends NavigatorObserver { | ||
| 42 | if (Get.isLogEnable) print("[GOING TO ROUTE] ${route?.settings?.name}"); | 50 | if (Get.isLogEnable) print("[GOING TO ROUTE] ${route?.settings?.name}"); |
| 43 | } | 51 | } |
| 44 | 52 | ||
| 53 | + isSnackbar = '${route?.settings?.name}' == 'snackbar'; | ||
| 54 | + isDialog = '${route?.settings?.name}' == 'dialog'; | ||
| 55 | + isBottomSheet = '${route?.settings?.name}' == 'bottomsheet'; | ||
| 56 | + | ||
| 45 | final routeSend = Routing( | 57 | final routeSend = Routing( |
| 46 | removed: null, | 58 | removed: null, |
| 47 | isBack: false, | 59 | isBack: false, |
| @@ -50,9 +62,9 @@ class GetObserver extends NavigatorObserver { | @@ -50,9 +62,9 @@ class GetObserver extends NavigatorObserver { | ||
| 50 | previous: '${previousRoute?.settings?.name}', | 62 | previous: '${previousRoute?.settings?.name}', |
| 51 | args: route?.settings?.arguments, | 63 | args: route?.settings?.arguments, |
| 52 | previousArgs: previousRoute?.settings?.arguments, | 64 | previousArgs: previousRoute?.settings?.arguments, |
| 53 | - isSnackbar: '${route?.settings?.name}' == 'snackbar', | ||
| 54 | - isDialog: '${route?.settings?.name}' == 'dialog', | ||
| 55 | - isBottomSheet: '${route?.settings?.name}' == 'bottomsheet', | 65 | + isSnackbar: isSnackbar, |
| 66 | + isDialog: isDialog, | ||
| 67 | + isBottomSheet: isBottomSheet, | ||
| 56 | ); | 68 | ); |
| 57 | if (routing != null) { | 69 | if (routing != null) { |
| 58 | routing(routeSend); | 70 | routing(routeSend); |
| @@ -77,6 +89,10 @@ class GetObserver extends NavigatorObserver { | @@ -77,6 +89,10 @@ class GetObserver extends NavigatorObserver { | ||
| 77 | if (Get.isLogEnable) print("[BACK ROUTE] ${route?.settings?.name}"); | 89 | if (Get.isLogEnable) print("[BACK ROUTE] ${route?.settings?.name}"); |
| 78 | } | 90 | } |
| 79 | 91 | ||
| 92 | + isSnackbar = false; | ||
| 93 | + isDialog = false; | ||
| 94 | + isBottomSheet = false; | ||
| 95 | + | ||
| 80 | final routeSend = Routing( | 96 | final routeSend = Routing( |
| 81 | removed: null, | 97 | removed: null, |
| 82 | isBack: true, | 98 | isBack: true, |
| @@ -102,6 +118,10 @@ class GetObserver extends NavigatorObserver { | @@ -102,6 +118,10 @@ class GetObserver extends NavigatorObserver { | ||
| 102 | if (Get.isLogEnable) print("[REPLACE ROUTE] ${oldRoute?.settings?.name}"); | 118 | if (Get.isLogEnable) print("[REPLACE ROUTE] ${oldRoute?.settings?.name}"); |
| 103 | if (Get.isLogEnable) print("[NEW ROUTE] ${newRoute?.settings?.name}"); | 119 | if (Get.isLogEnable) print("[NEW ROUTE] ${newRoute?.settings?.name}"); |
| 104 | 120 | ||
| 121 | + isSnackbar = false; | ||
| 122 | + isDialog = false; | ||
| 123 | + isBottomSheet = false; | ||
| 124 | + | ||
| 105 | final routeSend = Routing( | 125 | final routeSend = Routing( |
| 106 | removed: null, // add '${oldRoute?.settings?.name}' or remain null ??? | 126 | removed: null, // add '${oldRoute?.settings?.name}' or remain null ??? |
| 107 | isBack: false, | 127 | isBack: false, |
| @@ -109,9 +129,9 @@ class GetObserver extends NavigatorObserver { | @@ -109,9 +129,9 @@ class GetObserver extends NavigatorObserver { | ||
| 109 | current: '${newRoute?.settings?.name}', | 129 | current: '${newRoute?.settings?.name}', |
| 110 | previous: '${oldRoute?.settings?.name}', | 130 | previous: '${oldRoute?.settings?.name}', |
| 111 | args: newRoute?.settings?.arguments, | 131 | args: newRoute?.settings?.arguments, |
| 112 | - isSnackbar: null, | ||
| 113 | - isBottomSheet: null, | ||
| 114 | - isDialog: null, | 132 | + isSnackbar: false, |
| 133 | + isBottomSheet: false, | ||
| 134 | + isDialog: false, | ||
| 115 | previousArgs: null); | 135 | previousArgs: null); |
| 116 | 136 | ||
| 117 | if (routing != null) { | 137 | if (routing != null) { |
| @@ -130,10 +150,9 @@ class GetObserver extends NavigatorObserver { | @@ -130,10 +150,9 @@ class GetObserver extends NavigatorObserver { | ||
| 130 | route: previousRoute, | 150 | route: previousRoute, |
| 131 | current: '${previousRoute?.settings?.name}', | 151 | current: '${previousRoute?.settings?.name}', |
| 132 | removed: '${route?.settings?.name}', | 152 | removed: '${route?.settings?.name}', |
| 133 | - previous: null, | ||
| 134 | - isSnackbar: null, | ||
| 135 | - isBottomSheet: null, | ||
| 136 | - isDialog: null, | 153 | + isSnackbar: isSnackbar, |
| 154 | + isBottomSheet: isBottomSheet, | ||
| 155 | + isDialog: isDialog, | ||
| 137 | args: previousRoute?.settings?.arguments, | 156 | args: previousRoute?.settings?.arguments, |
| 138 | previousArgs: route?.settings?.arguments); | 157 | previousArgs: route?.settings?.arguments); |
| 139 | 158 |
| @@ -23,10 +23,10 @@ class GetBuilder<T extends GetController> extends StatefulWidget { | @@ -23,10 +23,10 @@ class GetBuilder<T extends GetController> extends StatefulWidget { | ||
| 23 | final bool autoRemove; | 23 | final bool autoRemove; |
| 24 | final void Function(State state) initState, dispose, didChangeDependencies; | 24 | final void Function(State state) initState, dispose, didChangeDependencies; |
| 25 | final void Function(GetBuilder oldWidget, State state) didUpdateWidget; | 25 | final void Function(GetBuilder oldWidget, State state) didUpdateWidget; |
| 26 | - final T controller; | 26 | + final T init; |
| 27 | GetBuilder({ | 27 | GetBuilder({ |
| 28 | Key key, | 28 | Key key, |
| 29 | - this.controller, | 29 | + this.init, |
| 30 | this.global = true, | 30 | this.global = true, |
| 31 | this.builder, | 31 | this.builder, |
| 32 | this.autoRemove = true, | 32 | this.autoRemove = true, |
| @@ -34,7 +34,7 @@ class GetBuilder<T extends GetController> extends StatefulWidget { | @@ -34,7 +34,7 @@ class GetBuilder<T extends GetController> extends StatefulWidget { | ||
| 34 | this.dispose, | 34 | this.dispose, |
| 35 | this.didChangeDependencies, | 35 | this.didChangeDependencies, |
| 36 | this.didUpdateWidget, | 36 | this.didUpdateWidget, |
| 37 | - }) : assert(builder != null, controller != null), | 37 | + }) : assert(builder != null), |
| 38 | super(key: key); | 38 | super(key: key); |
| 39 | @override | 39 | @override |
| 40 | _GetBuilderState<T> createState() => _GetBuilderState<T>(); | 40 | _GetBuilderState<T> createState() => _GetBuilderState<T>(); |
| @@ -49,12 +49,12 @@ class _GetBuilderState<T extends GetController> extends State<GetBuilder<T>> { | @@ -49,12 +49,12 @@ class _GetBuilderState<T extends GetController> extends State<GetBuilder<T>> { | ||
| 49 | if (Get.isRegistred<T>()) { | 49 | if (Get.isRegistred<T>()) { |
| 50 | controller = Get.find<T>(); | 50 | controller = Get.find<T>(); |
| 51 | } else { | 51 | } else { |
| 52 | - controller = widget.controller; | 52 | + controller = widget.init; |
| 53 | controller._allStates[controller] = this; | 53 | controller._allStates[controller] = this; |
| 54 | Get.put(controller); | 54 | Get.put(controller); |
| 55 | } | 55 | } |
| 56 | } else { | 56 | } else { |
| 57 | - controller = widget.controller; | 57 | + controller = widget.init; |
| 58 | controller._allStates[controller] = this; | 58 | controller._allStates[controller] = this; |
| 59 | } | 59 | } |
| 60 | if (widget.initState != null) widget.initState(this); | 60 | if (widget.initState != null) widget.initState(this); |
| @@ -62,15 +62,15 @@ class _GetBuilderState<T extends GetController> extends State<GetBuilder<T>> { | @@ -62,15 +62,15 @@ class _GetBuilderState<T extends GetController> extends State<GetBuilder<T>> { | ||
| 62 | 62 | ||
| 63 | @override | 63 | @override |
| 64 | void dispose() { | 64 | void dispose() { |
| 65 | - if (controller != null) { | 65 | + if (widget.init != null) { |
| 66 | var b = controller; | 66 | var b = controller; |
| 67 | if (b._allStates[controller].hashCode == this.hashCode) { | 67 | if (b._allStates[controller].hashCode == this.hashCode) { |
| 68 | b._allStates.remove(controller); | 68 | b._allStates.remove(controller); |
| 69 | } | 69 | } |
| 70 | } | 70 | } |
| 71 | if (widget.dispose != null) widget.dispose(this); | 71 | if (widget.dispose != null) widget.dispose(this); |
| 72 | - if (widget.autoRemove && Get.isRegistred<T>()) { | ||
| 73 | - Get.delete(controller); | 72 | + if (widget.autoRemove && Get.isRegistred<T>() && (widget.init != null)) { |
| 73 | + Get.delete(widget.init); | ||
| 74 | } | 74 | } |
| 75 | super.dispose(); | 75 | super.dispose(); |
| 76 | } | 76 | } |
| 1 | # Generated by pub | 1 | # Generated by pub |
| 2 | # See https://dart.dev/tools/pub/glossary#lockfile | 2 | # See https://dart.dev/tools/pub/glossary#lockfile |
| 3 | packages: | 3 | packages: |
| 4 | - archive: | ||
| 5 | - dependency: transitive | ||
| 6 | - description: | ||
| 7 | - name: archive | ||
| 8 | - url: "https://pub.dartlang.org" | ||
| 9 | - source: hosted | ||
| 10 | - version: "2.0.13" | ||
| 11 | - args: | ||
| 12 | - dependency: transitive | ||
| 13 | - description: | ||
| 14 | - name: args | ||
| 15 | - url: "https://pub.dartlang.org" | ||
| 16 | - source: hosted | ||
| 17 | - version: "1.6.0" | ||
| 18 | async: | 4 | async: |
| 19 | dependency: transitive | 5 | dependency: transitive |
| 20 | description: | 6 | description: |
| @@ -36,27 +22,27 @@ packages: | @@ -36,27 +22,27 @@ packages: | ||
| 36 | url: "https://pub.dartlang.org" | 22 | url: "https://pub.dartlang.org" |
| 37 | source: hosted | 23 | source: hosted |
| 38 | version: "1.1.3" | 24 | version: "1.1.3" |
| 39 | - collection: | 25 | + clock: |
| 40 | dependency: transitive | 26 | dependency: transitive |
| 41 | description: | 27 | description: |
| 42 | - name: collection | 28 | + name: clock |
| 43 | url: "https://pub.dartlang.org" | 29 | url: "https://pub.dartlang.org" |
| 44 | source: hosted | 30 | source: hosted |
| 45 | - version: "1.14.12" | ||
| 46 | - convert: | 31 | + version: "1.0.1" |
| 32 | + collection: | ||
| 47 | dependency: transitive | 33 | dependency: transitive |
| 48 | description: | 34 | description: |
| 49 | - name: convert | 35 | + name: collection |
| 50 | url: "https://pub.dartlang.org" | 36 | url: "https://pub.dartlang.org" |
| 51 | source: hosted | 37 | source: hosted |
| 52 | - version: "2.1.1" | ||
| 53 | - crypto: | 38 | + version: "1.14.12" |
| 39 | + fake_async: | ||
| 54 | dependency: transitive | 40 | dependency: transitive |
| 55 | description: | 41 | description: |
| 56 | - name: crypto | 42 | + name: fake_async |
| 57 | url: "https://pub.dartlang.org" | 43 | url: "https://pub.dartlang.org" |
| 58 | source: hosted | 44 | source: hosted |
| 59 | - version: "2.1.4" | 45 | + version: "1.1.0" |
| 60 | flutter: | 46 | flutter: |
| 61 | dependency: "direct main" | 47 | dependency: "direct main" |
| 62 | description: flutter | 48 | description: flutter |
| @@ -67,13 +53,6 @@ packages: | @@ -67,13 +53,6 @@ packages: | ||
| 67 | description: flutter | 53 | description: flutter |
| 68 | source: sdk | 54 | source: sdk |
| 69 | version: "0.0.0" | 55 | version: "0.0.0" |
| 70 | - image: | ||
| 71 | - dependency: transitive | ||
| 72 | - description: | ||
| 73 | - name: image | ||
| 74 | - url: "https://pub.dartlang.org" | ||
| 75 | - source: hosted | ||
| 76 | - version: "2.1.12" | ||
| 77 | matcher: | 56 | matcher: |
| 78 | dependency: transitive | 57 | dependency: transitive |
| 79 | description: | 58 | description: |
| @@ -94,21 +73,7 @@ packages: | @@ -94,21 +73,7 @@ packages: | ||
| 94 | name: path | 73 | name: path |
| 95 | url: "https://pub.dartlang.org" | 74 | url: "https://pub.dartlang.org" |
| 96 | source: hosted | 75 | source: hosted |
| 97 | - version: "1.6.4" | ||
| 98 | - petitparser: | ||
| 99 | - dependency: transitive | ||
| 100 | - description: | ||
| 101 | - name: petitparser | ||
| 102 | - url: "https://pub.dartlang.org" | ||
| 103 | - source: hosted | ||
| 104 | - version: "2.4.0" | ||
| 105 | - quiver: | ||
| 106 | - dependency: transitive | ||
| 107 | - description: | ||
| 108 | - name: quiver | ||
| 109 | - url: "https://pub.dartlang.org" | ||
| 110 | - source: hosted | ||
| 111 | - version: "2.1.3" | 76 | + version: "1.7.0" |
| 112 | sky_engine: | 77 | sky_engine: |
| 113 | dependency: transitive | 78 | dependency: transitive |
| 114 | description: flutter | 79 | description: flutter |
| @@ -170,12 +135,5 @@ packages: | @@ -170,12 +135,5 @@ packages: | ||
| 170 | url: "https://pub.dartlang.org" | 135 | url: "https://pub.dartlang.org" |
| 171 | source: hosted | 136 | source: hosted |
| 172 | version: "2.0.8" | 137 | version: "2.0.8" |
| 173 | - xml: | ||
| 174 | - dependency: transitive | ||
| 175 | - description: | ||
| 176 | - name: xml | ||
| 177 | - url: "https://pub.dartlang.org" | ||
| 178 | - source: hosted | ||
| 179 | - version: "3.6.1" | ||
| 180 | sdks: | 138 | sdks: |
| 181 | dart: ">=2.6.0 <3.0.0" | 139 | dart: ">=2.6.0 <3.0.0" |
| 1 | name: get | 1 | name: get |
| 2 | description: Navigate between screens, display snackbars, dialogs and bottomSheets, from anywhere in your code without context with Get. | 2 | description: Navigate between screens, display snackbars, dialogs and bottomSheets, from anywhere in your code without context with Get. |
| 3 | -version: 2.0.0-dev | 3 | +version: 2.0.10 |
| 4 | homepage: https://github.com/jonataslaw/get | 4 | homepage: https://github.com/jonataslaw/get |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
-
Please register or login to post a comment