shirne_dialog 4.1.0 copy "shirne_dialog: ^4.1.0" to clipboard
shirne_dialog: ^4.1.0 copied to clipboard

outdated

A flutter package to use alert, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.

Shirne Dialog #

A flutter package to use alert, confirm, prompt, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.

pub package

function #

  • toast
  • alert
  • confirm
  • prompt [new]
  • modal
  • popup
  • imagePreview
  • snack
  • loading

Notice #

You must initialize ShirneDialogTheme on theme.extensions in flutter version 3.0.0

Usage #

Direct 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');

initialize & usage

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

// Or use Mydialog.navigatorKey with MaterialApp
// and set theme for dialog
 MaterialApp(
    //...
    navigatorKey: MyDialog.navigatorKey,
    localizationsDelegates:[
        ShirneDialogLocalizations.delegate,

        // flutter locals see [https://docs.flutter.dev/development/accessibility-and-localization/internationalization]
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
    ],
    theme: ThemeData.light().copyWith(extensions: [const ShirneDialogTheme()]);
    //...
 );
 

// call in anywhere
MyDialog.confirm('aaa');
MyDialog.alert('test');
MyDialog.toase('test');

Demo

37
likes
0
pub points
81%
popularity

Publisher

verified publishershirne.com

A flutter package to use alert, toast, popup, snack, imagePreview, loading etc. with customizable style in anywhere.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

combined_animation, flutter

More

Packages that depend on shirne_dialog