Showing
5 changed files
with
125 additions
and
123 deletions
| 1 | - ## [4.2.4] | ||
| 2 | -- Added anchorRoute and filterPages to | ||
| 3 | - | ||
| 4 | - | ||
| 5 | - // anchorRoute: '/', | ||
| 6 | - // filterPages: | ||
| 7 | - | 1 | + ## [4.2.5] |
| 2 | +- Added anchorRoute and filterPages to GetRouterOutlet (@ahmednfwela) | ||
| 3 | +- Added scrollBehavior and scaffoldMessengerKey to GetMaterialapp(@ejabu and @alionour) | ||
| 4 | +- Fix error when child on MaterialApp is null (@ahmednfwela) | ||
| 5 | +- Fix Korean docs (@rws08) | ||
| 6 | +- Fix error with onClose called before routeTransition on Get.offNamed | ||
| 8 | 7 | ||
| 9 | ## [4.2.4] | 8 | ## [4.2.4] |
| 10 | - Fix Get.offAll removing GetxServices from memory | 9 | - Fix Get.offAll removing GetxServices from memory |
| @@ -240,7 +240,7 @@ class GetInstance { | @@ -240,7 +240,7 @@ class GetInstance { | ||
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | for (final element in keysToRemove) { | 242 | for (final element in keysToRemove) { |
| 243 | - reload(key: element); | 243 | + reload(key: element, closeInstance: false); |
| 244 | //_routesKey.remove(element); | 244 | //_routesKey.remove(element); |
| 245 | } | 245 | } |
| 246 | 246 | ||
| @@ -459,7 +459,11 @@ class GetInstance { | @@ -459,7 +459,11 @@ class GetInstance { | ||
| 459 | }); | 459 | }); |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | - void reload<S>({String? tag, String? key, bool force = false}) { | 462 | + void reload<S>( |
| 463 | + {String? tag, | ||
| 464 | + String? key, | ||
| 465 | + bool force = false, | ||
| 466 | + bool closeInstance = true}) { | ||
| 463 | final newKey = key ?? _getKey(S, tag); | 467 | final newKey = key ?? _getKey(S, tag); |
| 464 | 468 | ||
| 465 | final builder = _getDependency<S>(tag: tag, key: newKey); | 469 | final builder = _getDependency<S>(tag: tag, key: newKey); |
| @@ -479,7 +483,7 @@ class GetInstance { | @@ -479,7 +483,7 @@ class GetInstance { | ||
| 479 | return; | 483 | return; |
| 480 | } | 484 | } |
| 481 | 485 | ||
| 482 | - if (i is GetLifeCycleBase) { | 486 | + if (i is GetLifeCycleBase && closeInstance) { |
| 483 | i.onDelete(); | 487 | i.onDelete(); |
| 484 | Get.log('"$newKey" onDelete() called'); | 488 | Get.log('"$newKey" onDelete() called'); |
| 485 | } | 489 | } |
| @@ -196,122 +196,121 @@ class GetCupertinoApp extends StatelessWidget { | @@ -196,122 +196,121 @@ class GetCupertinoApp extends StatelessWidget { | ||
| 196 | ]; | 196 | ]; |
| 197 | } | 197 | } |
| 198 | 198 | ||
| 199 | + Widget defaultBuilder(BuildContext context, Widget? child) { | ||
| 200 | + return Directionality( | ||
| 201 | + textDirection: textDirection ?? | ||
| 202 | + (rtlLanguages.contains(Get.locale?.languageCode) | ||
| 203 | + ? TextDirection.rtl | ||
| 204 | + : TextDirection.ltr), | ||
| 205 | + child: builder == null | ||
| 206 | + ? (child ?? Material()) | ||
| 207 | + : builder!(context, child ?? Material()), | ||
| 208 | + ); | ||
| 209 | + } | ||
| 210 | + | ||
| 199 | @override | 211 | @override |
| 200 | Widget build(BuildContext context) => GetBuilder<GetMaterialController>( | 212 | Widget build(BuildContext context) => GetBuilder<GetMaterialController>( |
| 201 | - init: Get.rootController, | ||
| 202 | - dispose: (d) { | ||
| 203 | - onDispose?.call(); | ||
| 204 | - }, | ||
| 205 | - initState: (i) { | ||
| 206 | - Get.engine!.addPostFrameCallback((timeStamp) { | ||
| 207 | - onReady?.call(); | ||
| 208 | - }); | ||
| 209 | - if (locale != null) Get.locale = locale; | 213 | + init: Get.rootController, |
| 214 | + dispose: (d) { | ||
| 215 | + onDispose?.call(); | ||
| 216 | + }, | ||
| 217 | + initState: (i) { | ||
| 218 | + Get.engine!.addPostFrameCallback((timeStamp) { | ||
| 219 | + onReady?.call(); | ||
| 220 | + }); | ||
| 221 | + if (locale != null) Get.locale = locale; | ||
| 210 | 222 | ||
| 211 | - if (fallbackLocale != null) Get.fallbackLocale = fallbackLocale; | 223 | + if (fallbackLocale != null) Get.fallbackLocale = fallbackLocale; |
| 212 | 224 | ||
| 213 | - if (translations != null) { | ||
| 214 | - Get.addTranslations(translations!.keys); | ||
| 215 | - } else if (translationsKeys != null) { | ||
| 216 | - Get.addTranslations(translationsKeys!); | ||
| 217 | - } | 225 | + if (translations != null) { |
| 226 | + Get.addTranslations(translations!.keys); | ||
| 227 | + } else if (translationsKeys != null) { | ||
| 228 | + Get.addTranslations(translationsKeys!); | ||
| 229 | + } | ||
| 218 | 230 | ||
| 219 | - Get.customTransition = customTransition; | 231 | + Get.customTransition = customTransition; |
| 220 | 232 | ||
| 221 | - initialBinding?.dependencies(); | ||
| 222 | - if (getPages != null) { | ||
| 223 | - Get.addPages(getPages!); | ||
| 224 | - } | 233 | + initialBinding?.dependencies(); |
| 234 | + if (getPages != null) { | ||
| 235 | + Get.addPages(getPages!); | ||
| 236 | + } | ||
| 225 | 237 | ||
| 226 | - Get.smartManagement = smartManagement; | ||
| 227 | - onInit?.call(); | 238 | + Get.smartManagement = smartManagement; |
| 239 | + onInit?.call(); | ||
| 228 | 240 | ||
| 229 | - Get.config( | ||
| 230 | - enableLog: enableLog ?? Get.isLogEnable, | ||
| 231 | - logWriterCallback: logWriterCallback, | ||
| 232 | - defaultTransition: defaultTransition ?? Get.defaultTransition, | ||
| 233 | - defaultOpaqueRoute: opaqueRoute ?? Get.isOpaqueRouteDefault, | ||
| 234 | - defaultPopGesture: popGesture ?? Get.isPopGestureEnable, | ||
| 235 | - defaultDurationTransition: | ||
| 236 | - transitionDuration ?? Get.defaultTransitionDuration, | ||
| 237 | - ); | ||
| 238 | - }, | ||
| 239 | - builder: (_) => routerDelegate != null | ||
| 240 | - ? CupertinoApp.router( | ||
| 241 | - routerDelegate: routerDelegate!, | ||
| 242 | - routeInformationParser: routeInformationParser!, | ||
| 243 | - backButtonDispatcher: backButtonDispatcher, | ||
| 244 | - routeInformationProvider: routeInformationProvider, | ||
| 245 | - key: _.unikey, | ||
| 246 | - theme: theme, | ||
| 247 | - builder: (context, child) { | ||
| 248 | - return Directionality( | ||
| 249 | - textDirection: textDirection ?? | ||
| 250 | - (rtlLanguages.contains(Get.locale?.languageCode) | ||
| 251 | - ? TextDirection.rtl | ||
| 252 | - : TextDirection.ltr), | ||
| 253 | - child: builder == null ? child! : builder!(context, child), | ||
| 254 | - ); | ||
| 255 | - }, | ||
| 256 | - title: title, | ||
| 257 | - onGenerateTitle: onGenerateTitle, | ||
| 258 | - color: color, | ||
| 259 | - locale: Get.locale ?? locale, | ||
| 260 | - localizationsDelegates: localizationsDelegates, | ||
| 261 | - localeListResolutionCallback: localeListResolutionCallback, | ||
| 262 | - localeResolutionCallback: localeResolutionCallback, | ||
| 263 | - supportedLocales: supportedLocales, | ||
| 264 | - showPerformanceOverlay: showPerformanceOverlay, | ||
| 265 | - checkerboardRasterCacheImages: checkerboardRasterCacheImages, | ||
| 266 | - checkerboardOffscreenLayers: checkerboardOffscreenLayers, | ||
| 267 | - showSemanticsDebugger: showSemanticsDebugger, | ||
| 268 | - debugShowCheckedModeBanner: debugShowCheckedModeBanner, | ||
| 269 | - shortcuts: shortcuts, | ||
| 270 | - ) | ||
| 271 | - : CupertinoApp( | ||
| 272 | - key: _.unikey, | ||
| 273 | - theme: theme, | ||
| 274 | - navigatorKey: | ||
| 275 | - (navigatorKey == null ? Get.key : Get.addKey(navigatorKey!)), | ||
| 276 | - home: home, | ||
| 277 | - routes: routes ?? const <String, WidgetBuilder>{}, | ||
| 278 | - initialRoute: initialRoute, | ||
| 279 | - onGenerateRoute: (getPages != null ? generator : onGenerateRoute), | ||
| 280 | - onGenerateInitialRoutes: (getPages == null || home != null) | ||
| 281 | - ? onGenerateInitialRoutes | ||
| 282 | - : initialRoutesGenerate, | ||
| 283 | - onUnknownRoute: onUnknownRoute, | ||
| 284 | - navigatorObservers: (navigatorObservers == null | ||
| 285 | - ? <NavigatorObserver>[ | ||
| 286 | - GetObserver(routingCallback, Get.routing) | ||
| 287 | - ] | ||
| 288 | - : <NavigatorObserver>[ | ||
| 289 | - GetObserver(routingCallback, Get.routing) | ||
| 290 | - ] | ||
| 291 | - ..addAll(navigatorObservers!)), | ||
| 292 | - builder: (context, child) { | ||
| 293 | - return Directionality( | ||
| 294 | - textDirection: textDirection ?? | ||
| 295 | - (rtlLanguages.contains(Get.locale?.languageCode) | ||
| 296 | - ? TextDirection.rtl | ||
| 297 | - : TextDirection.ltr), | ||
| 298 | - child: builder == null ? child! : builder!(context, child), | ||
| 299 | - ); | ||
| 300 | - }, | ||
| 301 | - title: title, | ||
| 302 | - onGenerateTitle: onGenerateTitle, | ||
| 303 | - color: color, | ||
| 304 | - locale: Get.locale ?? locale, | ||
| 305 | - localizationsDelegates: localizationsDelegates, | ||
| 306 | - localeListResolutionCallback: localeListResolutionCallback, | ||
| 307 | - localeResolutionCallback: localeResolutionCallback, | ||
| 308 | - supportedLocales: supportedLocales, | ||
| 309 | - showPerformanceOverlay: showPerformanceOverlay, | ||
| 310 | - checkerboardRasterCacheImages: checkerboardRasterCacheImages, | ||
| 311 | - checkerboardOffscreenLayers: checkerboardOffscreenLayers, | ||
| 312 | - showSemanticsDebugger: showSemanticsDebugger, | ||
| 313 | - debugShowCheckedModeBanner: debugShowCheckedModeBanner, | ||
| 314 | - shortcuts: shortcuts, | ||
| 315 | - // actions: actions, | ||
| 316 | - )); | 241 | + Get.config( |
| 242 | + enableLog: enableLog ?? Get.isLogEnable, | ||
| 243 | + logWriterCallback: logWriterCallback, | ||
| 244 | + defaultTransition: defaultTransition ?? Get.defaultTransition, | ||
| 245 | + defaultOpaqueRoute: opaqueRoute ?? Get.isOpaqueRouteDefault, | ||
| 246 | + defaultPopGesture: popGesture ?? Get.isPopGestureEnable, | ||
| 247 | + defaultDurationTransition: | ||
| 248 | + transitionDuration ?? Get.defaultTransitionDuration, | ||
| 249 | + ); | ||
| 250 | + }, | ||
| 251 | + builder: (_) => routerDelegate != null | ||
| 252 | + ? CupertinoApp.router( | ||
| 253 | + routerDelegate: routerDelegate!, | ||
| 254 | + routeInformationParser: routeInformationParser!, | ||
| 255 | + backButtonDispatcher: backButtonDispatcher, | ||
| 256 | + routeInformationProvider: routeInformationProvider, | ||
| 257 | + key: _.unikey, | ||
| 258 | + theme: theme, | ||
| 259 | + builder: defaultBuilder, | ||
| 260 | + title: title, | ||
| 261 | + onGenerateTitle: onGenerateTitle, | ||
| 262 | + color: color, | ||
| 263 | + locale: Get.locale ?? locale, | ||
| 264 | + localizationsDelegates: localizationsDelegates, | ||
| 265 | + localeListResolutionCallback: localeListResolutionCallback, | ||
| 266 | + localeResolutionCallback: localeResolutionCallback, | ||
| 267 | + supportedLocales: supportedLocales, | ||
| 268 | + showPerformanceOverlay: showPerformanceOverlay, | ||
| 269 | + checkerboardRasterCacheImages: checkerboardRasterCacheImages, | ||
| 270 | + checkerboardOffscreenLayers: checkerboardOffscreenLayers, | ||
| 271 | + showSemanticsDebugger: showSemanticsDebugger, | ||
| 272 | + debugShowCheckedModeBanner: debugShowCheckedModeBanner, | ||
| 273 | + shortcuts: shortcuts, | ||
| 274 | + ) | ||
| 275 | + : CupertinoApp( | ||
| 276 | + key: _.unikey, | ||
| 277 | + theme: theme, | ||
| 278 | + navigatorKey: (navigatorKey == null | ||
| 279 | + ? Get.key | ||
| 280 | + : Get.addKey(navigatorKey!)), | ||
| 281 | + home: home, | ||
| 282 | + routes: routes ?? const <String, WidgetBuilder>{}, | ||
| 283 | + initialRoute: initialRoute, | ||
| 284 | + onGenerateRoute: | ||
| 285 | + (getPages != null ? generator : onGenerateRoute), | ||
| 286 | + onGenerateInitialRoutes: (getPages == null || home != null) | ||
| 287 | + ? onGenerateInitialRoutes | ||
| 288 | + : initialRoutesGenerate, | ||
| 289 | + onUnknownRoute: onUnknownRoute, | ||
| 290 | + navigatorObservers: (navigatorObservers == null | ||
| 291 | + ? <NavigatorObserver>[ | ||
| 292 | + GetObserver(routingCallback, Get.routing) | ||
| 293 | + ] | ||
| 294 | + : <NavigatorObserver>[ | ||
| 295 | + GetObserver(routingCallback, Get.routing) | ||
| 296 | + ] | ||
| 297 | + ..addAll(navigatorObservers!)), | ||
| 298 | + builder: defaultBuilder, | ||
| 299 | + title: title, | ||
| 300 | + onGenerateTitle: onGenerateTitle, | ||
| 301 | + color: color, | ||
| 302 | + locale: Get.locale ?? locale, | ||
| 303 | + localizationsDelegates: localizationsDelegates, | ||
| 304 | + localeListResolutionCallback: localeListResolutionCallback, | ||
| 305 | + localeResolutionCallback: localeResolutionCallback, | ||
| 306 | + supportedLocales: supportedLocales, | ||
| 307 | + showPerformanceOverlay: showPerformanceOverlay, | ||
| 308 | + checkerboardRasterCacheImages: checkerboardRasterCacheImages, | ||
| 309 | + checkerboardOffscreenLayers: checkerboardOffscreenLayers, | ||
| 310 | + showSemanticsDebugger: showSemanticsDebugger, | ||
| 311 | + debugShowCheckedModeBanner: debugShowCheckedModeBanner, | ||
| 312 | + shortcuts: shortcuts, | ||
| 313 | + // actions: actions, | ||
| 314 | + ), | ||
| 315 | + ); | ||
| 317 | } | 316 | } |
| @@ -220,8 +220,8 @@ class GetMaterialApp extends StatelessWidget { | @@ -220,8 +220,8 @@ class GetMaterialApp extends StatelessWidget { | ||
| 220 | ? TextDirection.rtl | 220 | ? TextDirection.rtl |
| 221 | : TextDirection.ltr), | 221 | : TextDirection.ltr), |
| 222 | child: builder == null | 222 | child: builder == null |
| 223 | - ? (child ?? SizedBox.shrink()) | ||
| 224 | - : builder!(context, child), | 223 | + ? (child ?? Material()) |
| 224 | + : builder!(context, child ?? Material()), | ||
| 225 | ); | 225 | ); |
| 226 | } | 226 | } |
| 227 | 227 |
| 1 | name: get | 1 | name: get |
| 2 | description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX. | 2 | description: Open screens/snackbars/dialogs without context, manage states and inject dependencies easily with GetX. |
| 3 | -version: 4.2.4 | 3 | +version: 4.2.5 |
| 4 | homepage: https://github.com/jonataslaw/getx | 4 | homepage: https://github.com/jonataslaw/getx |
| 5 | 5 | ||
| 6 | environment: | 6 | environment: |
-
Please register or login to post a comment