marcos930807 / awesomeDialogs

A new Flutter package project for simple a awesome dialogs
Other
339 stars 110 forks source link

Crossplatform compatibility #1

Closed jedjie closed 4 years ago

jedjie commented 4 years ago

I love awesome_dialog but my concern it should also run in both Material and Cupertino. Can we request a crossplatform compatibility? Thank you! 🍡

marcos930807 commented 4 years ago

It should work on both because is a pure Dart Library.

jedjie commented 4 years ago

Okay I will use it then. Thank you! Godbless! 💯 🥇

jedjie commented 4 years ago

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.

marcos930807 commented 4 years ago

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

jedjie commented 4 years ago

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!

marcos930807 commented 4 years ago

@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.

jedjie commented 4 years ago

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.