Open astrO1 opened 3 years ago
I have a Custom Dialog Progress but when something goes wrong i show the Get.snackbar this on my code:
return InkWell( onTap: () async { Navigator.of(widget.scaffoldKey.currentContext).pop(); UtilService.showLoading(widget.scaffoldKey.currentContext, 'Selecionando endereço'); Timer(Duration(seconds: 1), () { // _con.changeDeliveryAddress(_con.addresses.elementAt(index)) .then((value) async { Navigator.of(widget.scaffoldKey.currentContext).pop(); }); }); },
This line of code Navigator.of(widget.scaffoldKey.currentContext).pop(); is simple to remove the dialog that i created but if somethings wrong inside this function i show a Get.snackbar
Future<void> changeDeliveryAddress(model.Address address) async { MapsUtil mapsUtil = new MapsUtil(); return await mapsUtil.getTaxByDistance(address, restaurantService.getRestaurant().id) .then((value) async { if(value['success']) { await settingRepo.changeCurrentLocation(address); setState(() { settingRepo.deliveryAddress.value = address; }); settingRepo.deliveryAddress.notifyListeners(); } else { UtilService.showErrorSnack('Este restaurante não atende esta região'); } return value; }); }
static showErrorSnack(message) { Get.snackbar("Atenção", message, backgroundColor: ThemeColor.AppErroColor, colorText: Colors.white); }
The problem is that this code removes the snackbar, not the Dialog is like this snackbar is a dialog
Maybe Snackbar managed by ScaffoldMessenger (new in Flutter 2.0) can be of help.
I have a Custom Dialog Progress but when something goes wrong i show the Get.snackbar this on my code:
This line of code Navigator.of(widget.scaffoldKey.currentContext).pop(); is simple to remove the dialog that i created but if somethings wrong inside this function i show a Get.snackbar
The problem is that this code removes the snackbar, not the Dialog is like this snackbar is a dialog