Snappy Toast
A lightweight, snappy toast and snackbar manager for Flutter.
โจ Show beautiful toast messages or stylish snackbars โ without needing BuildContext, Navigator, or Stack setup.
๐ก Why Snappy Toast?
Avoid boilerplate code. Works outside widget tree or Navigator stacks. Clean overlay-based toast & snackbar manager.
๐ Features
- โ Show toast anywhere โ without context!
- ๐ช Snackbar support too โ separate from toast
- ๐ Queue system with prioritization
- ๐จ Multiple toast styles (minimal or detailed)
- ๐ฑ Configurable position (top, center, bottom)
- ๐งฉ Custom icons, durations, and dismiss types
- ๐ฅ Optional haptic feedback
- ๐ซ Auto-dismiss and swipe-to-dismiss support
๐ Installation
Add the dependency to your pubspec.yaml:
dependencies:
snappy_toast: latest_version
๐งช Example Usage
1๏ธโฃ Initialize
Wrap anywhere in your app with SmartSnackToastWrapper:
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Smart FormX Demo',
theme: ThemeData(primarySwatch: Colors.blue),
home: SmartSnackToastWrapper(child: const SmartFormDemo()),
);
}
}
โ You don't need a navigatorKey or extra Stack.
2๏ธโฃ Show a Toast
SnappyToast.show(
message: "Hello from toast!",
type: ToastType.success,
position: ToastPosition.bottom,
);
3๏ธโฃ Show a Snackbar
SnappyToast.show(
message: "This is a snackbar",
type: ToastType.warning,
duration: Duration(seconds: 3),
);
๐ Configurations
| Parameter | Description | Default |
|---|---|---|
type |
success, error, warning, info | info |
position |
top, center, bottom (toast only) | bottom |
style |
minimal, detailed | detailed |
dismissType |
swipe or onTap | swipe |
duration |
Show time | 2 seconds |
customIcon |
Override the icon | null |
priority |
Priority in the toast queue | 0 |
haptic |
Enable haptic feedback | false |
dismissAll |
Remove all previous toasts/snackbars | false |
โจ Author
Made with โค๏ธ by Samuel & Atul
Libraries
- snappy_toast
- A lightweight, no-context, no-navigator-key toast/snackbar manager for Flutter.