Showing
1 changed file
with
10 additions
and
8 deletions
| @@ -2,6 +2,7 @@ import 'dart:ui' as ui; | @@ -2,6 +2,7 @@ import 'dart:ui' as ui; | ||
| 2 | 2 | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | import 'package:flutter/scheduler.dart'; | 4 | import 'package:flutter/scheduler.dart'; |
| 5 | + | ||
| 5 | import '../../get_core/get_core.dart'; | 6 | import '../../get_core/get_core.dart'; |
| 6 | import '../../get_instance/src/bindings_interface.dart'; | 7 | import '../../get_instance/src/bindings_interface.dart'; |
| 7 | import '../../get_utils/get_utils.dart'; | 8 | import '../../get_utils/get_utils.dart'; |
| @@ -592,11 +593,11 @@ extension GetNavigation on GetInterface { | @@ -592,11 +593,11 @@ extension GetNavigation on GetInterface { | ||
| 592 | /// | 593 | /// |
| 593 | /// Obs: unlike other get methods, this one you need to send a function | 594 | /// Obs: unlike other get methods, this one you need to send a function |
| 594 | /// that returns the widget to the page argument, like this: | 595 | /// that returns the widget to the page argument, like this: |
| 595 | - /// Get.offUntil( () => HomePage() ) | 596 | + /// Get.offUntil(GetPageRoute(page: () => HomePage()), predicate) |
| 596 | /// | 597 | /// |
| 597 | /// [predicate] can be used like this: | 598 | /// [predicate] can be used like this: |
| 598 | - /// `Get.until((route) => Get.currentRoute == '/home')`so when you get to home page, | ||
| 599 | - /// | 599 | + /// `Get.offUntil(page, (route) => (route as GetPageRoute).routeName == '/home')` |
| 600 | + /// to pop routes in stack until home, | ||
| 600 | /// or also like this: | 601 | /// or also like this: |
| 601 | /// `Get.until((route) => !Get.isDialogOpen())`, to make sure the dialog | 602 | /// `Get.until((route) => !Get.isDialogOpen())`, to make sure the dialog |
| 602 | /// is closed | 603 | /// is closed |
| @@ -617,12 +618,13 @@ extension GetNavigation on GetInterface { | @@ -617,12 +618,13 @@ extension GetNavigation on GetInterface { | ||
| 617 | /// as explained in documentation | 618 | /// as explained in documentation |
| 618 | /// | 619 | /// |
| 619 | /// [predicate] can be used like this: | 620 | /// [predicate] can be used like this: |
| 620 | - /// `Get.until((route) => Get.currentRoute == '/home')`so when you get to home page, | ||
| 621 | - /// or also like | ||
| 622 | - /// `Get.until((route) => !Get.isDialogOpen())`, to make sure the dialog | ||
| 623 | - /// is closed | 621 | + /// `Get.offNamedUntil(page, (route) => (route as GetPageRoute).routeName == '/home')` |
| 622 | + /// to pop routes in stack until home, | ||
| 623 | + /// or like this: | ||
| 624 | + /// `Get.offNamedUntil((route) => !Get.isDialogOpen())`, | ||
| 625 | + /// to make sure the dialog is closed | ||
| 624 | /// | 626 | /// |
| 625 | - /// Note: Always put a slash on the route ('/page1'), to avoid unnexpected errors | 627 | + /// Note: Always put a slash on the route name ('/page1'), to avoid unexpected errors |
| 626 | Future<T> offNamedUntil<T>( | 628 | Future<T> offNamedUntil<T>( |
| 627 | String page, | 629 | String page, |
| 628 | RoutePredicate predicate, { | 630 | RoutePredicate predicate, { |
-
Please register or login to post a comment