Skip to content
pubscout

shirne_dialog

4.9.0, released 11 months ago by shirne.com

A package to use alert, toast, popup, snack, and loading anywhere with customizable styles.

WASM-ready
$ flutter pub add shirne_dialog
Source repository

What it does

Provides a comprehensive collection of overlay-based UI components like alerts, confirms, prompts, toasts, modals, popups, image previews, snacks, loadings, and dropdowns. Can be called anywhere in the app using a navigator key without needing a BuildContext.

AI-written summary of version 4.9.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a quick way to show toasts, alerts, and confirmation dialogs from anywhere in your code.
  • You want customizable overlay widgets with support for custom themes.

Skip it when

  • You prefer strictly declarative state-driven dialog routing inside your widget tree.
  • You only need native platform dialogs.

Strengths

  • Allows calling dialogs and toasts anywhere without passing a BuildContext.
  • Supports a wide variety of dialog types including alerts, toasts, loading indicators, and dropdowns.

Weaknesses

  • Requires setting up a navigator key in your MaterialApp or router.
  • Older flutter versions require specific handling of theme extensions.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1

Add localizations and configure the navigatorKey in your MaterialApp or router, and register the ShirneDialogTheme.

MaterialApp(
    navigatorKey: MyDialog.navigatorKey,
    localizationsDelegates: [
        ShirneDialogLocalizations.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        GlobalCupertinoLocalizations.delegate,
    ],
    theme: ThemeData.light().copyWith(extensions: [const ShirneDialogTheme()]),
);

MyDialog.confirm('aaa');
MyDialog.alert('test');
MyDialog.toast('test');

Alternatives

Packages that do the same job and could replace shirne_dialog.