Closed jedjie closed 4 years ago
It should work on both because is a pure Dart Library.
Okay I will use it then. Thank you! Godbless! 💯 🥇
When using the btnOkOnPress with a Function Callback it doesnt pop internally, only on onDissmissCallback where the Function executes and the AlertDialog pops gracefully. I cant use the options of btnOkOnPress and btnCancellOnPress. Thank you.
Please elaborate an example of your issue or if possible share the code that does not work as expected. See de example Folder for how to use awesome_dialog. Example: AwesomeDialog( context: context, dialogType: DialogType.INFO, animType: AnimType.BOTTOMSLIDE, tittle: 'INFO', desc: 'Dialog description here..................................................', btnCancelOnPress: () { //Do wherever you want here }, btnOkOnPress: showDebugPrint) //Callback function for print on console .show();
Remebember if you especified your custom BtnOk or BtnCancel Widget you need to handle pop de dialog via dissmiss method or Navigator.of(context).pop
Hello Marco, Sorry for my Delayed reply when specifying the callback into the btnOkOnPress the Dialog stays opened and does not pop, I am using the built in button of AwesomeDialog.
Here is my code. 1) calling from my page screen void _processThings(BuildContext context){ if(isSuccess){ dlg.showAlertDialogOnOkCallback('Verified', 'Sign In Success!', DialogType.SUCCES, context, () => _slideMainPage(context)); } }
void _slideMainPage(BuildContext context) { Navigator.pushNamed(context, MainPage.id); }
2) on your Dialog void showAlertDialogOnOkCallback(String title, String msg, DialogType dialogType, BuildContext context, VoidCallback onOkPress) { AwesomeDialog( context: context, animType: AnimType.TOPSLIDE, dialogType: dialogType, tittle: title, desc: msg, btnOkIcon: Icons.check_circle, btnOkColor: Colors.green.shade900, btnOkOnPress: onOkPress, ).show(); }
The above code will not exit the dialog internally and thus will remain open, unless I will use it like this. btnOkOnPress: (){}, onDissmissCallback: onOkPress,
Thank you!
@jedjie Thank you very much for your time the problem was when using the event of pressing the buttons specifically to navigate. in version 0.0.3 it was fixed only to reverse the order first pop the dialog and then execute the Function, the order was not important except if the function of pressing the button was to navigate.
i think i already did that, of popping the dialog before call the next procedure.but the dialog pops and the next procedure does not continue, for example shifting to my next screen as I sampled on my actual case code, but still I would also suggest you give it a try. But on the OnDismissCallBack it does execute the next page like a charm.
I love awesome_dialog but my concern it should also run in both Material and Cupertino. Can we request a crossplatform compatibility? Thank you! 🍡