flutter_sonner_smooth library

A Sonner-inspired, buttery-smooth toast notification system for Flutter.

Zero dependencies, context-free, promise-aware, physics-animated.

Quick start

MaterialApp(
  builder: (context, child) => ToastLayer(child: child!),
  home: const HomePage(),
);

Then call from anywhere:

toast('Hello');
toast.success('Saved');
toast.promise(future, loading: '...', success: (_) => '...', error: (_) => '...');

Classes

Toast
The public API for showing, dismissing, and updating toasts.
ToastEntry
An immutable snapshot of a toast notification's data.
ToastLayer
Overlay widget that renders toast notification stacks.
ToastTheme
An InheritedWidget that provides ToastThemeData to descendant toasts.
ToastThemeData
Theme data controlling the visual appearance of toasts.

Enums

SwipeDirection
The direction a toast can be swiped to dismiss.
ToastPosition
Where on the screen a toast appears.
ToastStatus
The lifecycle status of a toast.
ToastType
The visual type of a toast, determining its icon and accent color.

Properties

toast → Toast
The global toast singleton. Call it directly or use its named methods.
final