Showing
5 changed files
with
37 additions
and
35 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,6 +196,18 @@ class GetCupertinoApp extends StatelessWidget { | @@ -196,6 +196,18 @@ 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, | 213 | init: Get.rootController, |
@@ -244,15 +256,7 @@ class GetCupertinoApp extends StatelessWidget { | @@ -244,15 +256,7 @@ class GetCupertinoApp extends StatelessWidget { | ||
244 | routeInformationProvider: routeInformationProvider, | 256 | routeInformationProvider: routeInformationProvider, |
245 | key: _.unikey, | 257 | key: _.unikey, |
246 | theme: theme, | 258 | 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 | - }, | 259 | + builder: defaultBuilder, |
256 | title: title, | 260 | title: title, |
257 | onGenerateTitle: onGenerateTitle, | 261 | onGenerateTitle: onGenerateTitle, |
258 | color: color, | 262 | color: color, |
@@ -271,12 +275,14 @@ class GetCupertinoApp extends StatelessWidget { | @@ -271,12 +275,14 @@ class GetCupertinoApp extends StatelessWidget { | ||
271 | : CupertinoApp( | 275 | : CupertinoApp( |
272 | key: _.unikey, | 276 | key: _.unikey, |
273 | theme: theme, | 277 | theme: theme, |
274 | - navigatorKey: | ||
275 | - (navigatorKey == null ? Get.key : Get.addKey(navigatorKey!)), | 278 | + navigatorKey: (navigatorKey == null |
279 | + ? Get.key | ||
280 | + : Get.addKey(navigatorKey!)), | ||
276 | home: home, | 281 | home: home, |
277 | routes: routes ?? const <String, WidgetBuilder>{}, | 282 | routes: routes ?? const <String, WidgetBuilder>{}, |
278 | initialRoute: initialRoute, | 283 | initialRoute: initialRoute, |
279 | - onGenerateRoute: (getPages != null ? generator : onGenerateRoute), | 284 | + onGenerateRoute: |
285 | + (getPages != null ? generator : onGenerateRoute), | ||
280 | onGenerateInitialRoutes: (getPages == null || home != null) | 286 | onGenerateInitialRoutes: (getPages == null || home != null) |
281 | ? onGenerateInitialRoutes | 287 | ? onGenerateInitialRoutes |
282 | : initialRoutesGenerate, | 288 | : initialRoutesGenerate, |
@@ -289,15 +295,7 @@ class GetCupertinoApp extends StatelessWidget { | @@ -289,15 +295,7 @@ class GetCupertinoApp extends StatelessWidget { | ||
289 | GetObserver(routingCallback, Get.routing) | 295 | GetObserver(routingCallback, Get.routing) |
290 | ] | 296 | ] |
291 | ..addAll(navigatorObservers!)), | 297 | ..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 | - }, | 298 | + builder: defaultBuilder, |
301 | title: title, | 299 | title: title, |
302 | onGenerateTitle: onGenerateTitle, | 300 | onGenerateTitle: onGenerateTitle, |
303 | color: color, | 301 | color: color, |
@@ -313,5 +311,6 @@ class GetCupertinoApp extends StatelessWidget { | @@ -313,5 +311,6 @@ class GetCupertinoApp extends StatelessWidget { | ||
313 | debugShowCheckedModeBanner: debugShowCheckedModeBanner, | 311 | debugShowCheckedModeBanner: debugShowCheckedModeBanner, |
314 | shortcuts: shortcuts, | 312 | shortcuts: shortcuts, |
315 | // actions: actions, | 313 | // actions: actions, |
316 | - )); | 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