pub package

dialog

A package for flutter to use alert and toast within one line code.

function

  • toast
  • alert
  • confirm
  • modal
  • popup
  • imagePreview
  • snack
  • loading

usage

MyDialog.of(context).toast('tip message');

MyDialog.of(context).alert(Text('alert message'));

MyDialog.of(context).confirm(Text('alert message')).then((v){

});

MyDialog.of(context).popup(Text('popup contents'));

MyDialog.of(context).snack('tip');

Or

// initialize in mainApp's first page
MyDialog.initialize(context,MyDialogSetting());

// Or use Mydialog.navigatorKey with MaterialApp
 MaterialApp(
    //...
    navigatorKey: MyDialog.navigatorKey,
    //...
 );
 
// call in anywhere
MyDialog.confirm('aaa');
MyDialog.alert('test');
MyDialog.toase('test');

Demo

Libraries

shirne_dialog