Open dengwei555 opened 1 year ago
@dengwei555
Get.back()
in this case mean you close "SnackBar"Get.back()
before show SnackBar like this
ElevatedButton(
onPressed: () {
Get.back();
Get.snackbar("notice", "noticeContent");
},
child: const Text(
"notice and back",
),
),
On an Apple phone, when the snackbar pops up, immediately sliding back to the previous page can also cause problems. So what should we do?
Agree with the last comment
As a workaround, we can use Get.until((route) => route== 'Name of your route');
Approach 1:
if you want to display snackbar and then want to navgate back to screen, you can this properties: snackbarStatus
Get.snackbar(
'Title',
'Message',
snackbarStatus: (status) {
if (status == SnackbarStatus.CLOSED) {
// ..
}
},
);
Approach 2: Closing a snackbar dynamically is a handy feature for when you need to return to a screen with open dialogues, bottom sheets, or snackbars. checkout this Reference
Get.back(closeOverlay = true / false) exists for this.
Describe the bug Use Get.snackbar() first in a component, and then continue to use Get.back(), neither of which takes effect
**Reproduction code
example:
To Reproduce Steps to reproduce the behavior:
get create page service
create pageExpected behavior Prompt information and return to the previous page
Screenshots
Flutter Version: 3.10.5
Getx Version: 4.6.5
Describe on which device you found the bug: ex: Chrome,android emulator, android device
Minimal reproduce code