flutter_awesome_snackbar 1.0.2
flutter_awesome_snackbar: ^1.0.2 copied to clipboard
Beautiful Flutter snackbars with queues, priorities, haptics, scheduling, history, glassmorphism, and RTL. Zero dependencies. Pure Flutter.
π₯ flutter_awesome_snackbar #
The most powerful, beautiful, and developer-friendly Flutter notification package.
Pure Flutter β zero external dependencies. Everything you need from a modern notification system, plus haptics, scheduling, routing, history, grouping, path animations, and more β all built on Flutter's own APIs.
β¨ Why flutter_awesome_snackbar? #
| Feature | flutter_awesome_snackbar | fluttertoast | another_flushbar | bot_toast | GetX Snackbar |
|---|---|---|---|---|---|
| All platforms | β | β οΈ Limited | β | β | β |
| State mgmt. agnostic | β | β | β | β | β |
| Queue system | β | β | β | β | β |
| Priority queue | β | β | β | β | β |
| Future tracking API | β | β | β | β | β |
| Glassmorphism | β | β | β | β | β |
| Built-in animations | β 9 styles | β | β οΈ 2 styles | β οΈ 3 styles | β οΈ Basic |
| Custom widget | β | β | β | β | β |
| Gradient backgrounds | β | β | β | β | β |
| Duplicate prevention | β | β | β | β | β |
| Dismiss by ID | β | β | β | β | β |
| Progress bar | β | β | β | β | β |
| RTL support | β | β | β | β | β |
| Dart 3 / null-safe | β | β | β | β | β |
| β Zero dependencies | β | β | β | β | β |
| β Haptic feedback | β | β | β | β | β |
| β Scheduling / delay | β | β | β | β | β |
| β Tap-to-route | β | β | β | β | β |
| β Notification history | β | β | β | β | β |
| β Grouped notifications | β | β | β | β | β |
| β Custom path animation | β | β | β | β | β |
| β Flip animation | β | β | β | β | β |
| β Dismiss group | β | β | β | β | β |
| β Accessibility labels | β | β | β | β | β |
| β Timestamp display | β | β | β | β | β |
| β Tap-through support | β | β | β | β | β |
| β Overlay scrim | β | β | β | β | β |
| β Cancel scheduled | β | β | β | β | β |
| β Dismiss callback | β | β | β | β | β |
π Quick Start (2 minutes) #
1. Install #
dependencies:
flutter_awesome_snackbar: ^1.0.0
flutter pub get
2. Initialize #
Wrap your MaterialApp.builder β that's it:
import 'package:flutter_awesome_snackbar/flutter_awesome_snackbar.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: AwesomeWidget.init(), // β one line
home: HomeScreen(),
);
}
}
3. Show notifications #
AwesomeSnackbar.success("Profile saved!");
AwesomeSnackbar.error("Payment failed.");
AwesomeSnackbar.warning("Weak internet connection.");
AwesomeSnackbar.info("Version 2.0 is available.");
Done. π
π¦ Zero External Dependencies #
flutter_awesome_snackbar is built entirely on Flutter's own APIs:
- Haptic feedback β Flutter's built-in
HapticFeedback(servicespackage) - Glassmorphism β
dart:ui'sImageFilter.blur+BackdropFilter - Animations β Flutter's
AnimationController,SlideTransition,FadeTransition, etc. - Overlay system β Flutter's native
Overlay+OverlayEntry
No vibration, audioplayers, flutter_animate, or any other third-party package is required.
ποΈ All APIs at a Glance #
Convenience methods #
AwesomeSnackbar.success("Saved");
AwesomeSnackbar.error("Failed", title: "Oops");
AwesomeSnackbar.warning("Low battery");
AwesomeSnackbar.info("New update");
final id = AwesomeSnackbar.loading("Uploading...");
AwesomeSnackbar.dismissById(id);
AwesomeSnackbar.dismissAll();
Full control with AwesomeOptions #
AwesomeSnackbar.show(AwesomeOptions(
title: "No Internet",
message: "Please check your connection.",
type: AwesomeType.error,
position: AwesomePosition.top,
animation: AwesomeAnimation.elastic,
duration: Duration(seconds: 5),
actionText: "Retry",
onAction: () => reconnect(),
secondaryActionText: "Dismiss",
onSecondaryAction: AwesomeSnackbar.dismissAll,
showProgress: true,
dismissDirection: AwesomeDismissDirection.horizontal,
priority: AwesomePriority.critical,
onDismiss: () => print("dismissed"),
dismissOnTap: false,
));
Future tracking #
await AwesomeSnackbar.future(
future: uploadData(),
loading: "Uploading your file...",
success: "Upload complete! π",
error: "Upload failed. Please retry.",
);
Dynamic messages based on result:
await AwesomeSnackbar.future<User>(
future: fetchUser(),
loading: "Fetching profile...",
success: (user) => "Welcome back, ${user.name}!",
error: (e) => "Error: ${e.toString()}",
);
Extension methods #
// On BuildContext
context.flashSuccess("Saved!");
context.flashError("Failed!");
// On String
"Done!".flashSuccess();
"Oops!".flashError();
// On Future
uploadFile().flashFuture(
loading: "Uploading...",
success: (_) => "Done!",
error: (e) => "Failed: $e",
);
β Unique Features #
Haptic feedback (built-in, no extra package) #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.success,
message: "Saved!",
haptic: AwesomeHaptic.success, // uses Flutter's HapticFeedback
));
Available: none, light, medium, heavy, success, warning, error, vibrate
Set globally:
AwesomeSnackbar.configure(AwesomeConfig(
defaultHaptic: AwesomeHaptic.light,
));
Scheduling & delayed notifications #
final sid = AwesomeSnackbar.schedule(
delay: Duration(seconds: 30),
options: AwesomeOptions(
type: AwesomeType.info,
message: "Reminder: stand up and stretch!",
),
);
// Cancel if no longer needed
AwesomeSnackbar.cancelScheduled(sid);
Tap-to-route #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.info,
message: "Your order shipped. Tap to track β",
routeName: "/order-tracking",
dismissOnTap: true,
));
Notification history #
// Read all history (newest first)
final records = AwesomeHistory.instance.all;
// Filter
final errors = AwesomeHistory.instance.byType(AwesomeType.error);
final tagged = AwesomeHistory.instance.byTag("checkout");
// Unread count
final unread = AwesomeHistory.instance.unreadCount;
// Mark all read / clear
AwesomeHistory.instance.markAllRead();
AwesomeHistory.instance.clear();
Grouped notifications #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.info,
message: "Alice sent you a message",
groupKey: "chat_alice",
));
// Dismiss the entire group
AwesomeSnackbar.dismissGroup("chat_alice");
Custom path animation #
AwesomeSnackbar.show(AwesomeOptions(
message: "Follows a custom arc!",
animation: AwesomeAnimation.path,
pathAnimation: Path()
..moveTo(-200, 0)
..quadraticBezierTo(0, -150, 0, 0),
));
Flip animation (3D card flip) #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.info,
message: "Card flip entrance",
animation: AwesomeAnimation.flip,
));
π¨ Customization #
Global config #
AwesomeSnackbar.configure(AwesomeConfig(
position: AwesomePosition.bottom,
animation: AwesomeAnimation.bounce,
duration: Duration(seconds: 3),
borderRadius: BorderRadius.circular(20),
blur: true, // glassmorphism globally
maxVisible: 3,
stackedMode: false,
showProgress: true,
defaultHaptic: AwesomeHaptic.light,
enableHistory: true,
showTimestamp: true,
overlayOpacity: 0.2,
tapThroughEnabled: false,
safeAreaInsets: true,
));
Custom theme per notification #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.custom,
message: "Premium feature unlocked.",
themeData: AwesomeThemeData(
backgroundColor: Color(0xFF1E1B4B),
textColor: Colors.white,
titleColor: Colors.amber,
iconColor: Colors.amberAccent,
actionColor: Colors.amber,
progressColor: Colors.amber,
borderColor: Color(0xFF312E81),
borderWidth: 1,
elevation: 8,
),
));
Gradient background #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.custom,
title: "Pro Plan",
message: "Upgrade to unlock all features.",
themeData: AwesomeThemeData(
backgroundColor: Colors.transparent,
textColor: Colors.white,
iconColor: Colors.white,
actionColor: Colors.amber,
gradient: LinearGradient(
colors: [Color(0xFF7C3AED), Color(0xFFEC4899)],
),
),
actionText: "Upgrade",
onAction: () => openUpgradeScreen(),
));
Glassmorphism (dart:ui β no external package) #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.success,
message: "Saved with glass effect!",
themeData: AwesomeThemeData.glassSuccess(dark: false),
));
Or globally:
AwesomeSnackbar.configure(AwesomeConfig(blur: true));
Custom widget #
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.custom,
customWidget: Row(
children: [
CircleAvatar(backgroundImage: NetworkImage(avatarUrl)),
SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("Alice sent you a message"),
Text("Hey! Are you free tonight?",
style: TextStyle(fontSize: 12)),
],
),
),
],
),
));
Custom animation builder #
AwesomeSnackbar.show(AwesomeOptions(
message: "Custom animation!",
animationBuilder: (controller, child) {
return SlideTransition(
position: Tween(begin: Offset(-2, 0), end: Offset.zero).animate(
CurvedAnimation(parent: controller, curve: Curves.elasticOut),
),
child: child,
);
},
));
ποΈ Animations (9 built-in) #
| Name | Description |
|---|---|
AwesomeAnimation.slide |
Slides in from the nearest edge |
AwesomeAnimation.fade |
Fades in/out smoothly |
AwesomeAnimation.scale |
Scales from center with ease-out-back |
AwesomeAnimation.elastic |
Spring-like elastic entrance |
AwesomeAnimation.bounce |
Bouncy entrance |
AwesomeAnimation.rotation |
Rotation + scale + fade |
AwesomeAnimation.ios |
iOS-style cubic-emphasized curve |
AwesomeAnimation.flip |
3D card-flip entrance β |
AwesomeAnimation.path |
Follows a custom Path β
|
π Queue & Priority #
// Standard FIFO order
AwesomeSnackbar.show(AwesomeOptions(
message: "Normal",
priority: AwesomePriority.normal,
));
// Jumps ahead of normal items
AwesomeSnackbar.show(AwesomeOptions(
message: "Important!",
priority: AwesomePriority.high,
));
// Goes to the front immediately
AwesomeSnackbar.show(AwesomeOptions(
type: AwesomeType.error,
message: "Critical error!",
priority: AwesomePriority.critical,
));
π Duplicate Prevention #
// Only one notification is ever shown, even if called multiple times
for (int i = 0; i < 5; i++) {
AwesomeSnackbar.show(AwesomeOptions(
message: "You are offline",
key: "offline_banner",
));
}
π Platform Support #
| Platform | Supported |
|---|---|
| Android | β |
| iOS | β |
| Web | β |
| Windows | β |
| macOS | β |
| Linux | β |
π§© State Management #
Zero dependency on any state management solution:
- β
GetX β call
AwesomeSnackbar.success(...)anywhere - β Provider β no setup needed
- β
Riverpod β works in any
ref.read()or callback - β
Bloc / Cubit β call from
BlocListener - β MobX β call from reactions
- β
Stacked β call from
ViewModelBuilder - β setState β just call it!
πΊοΈ Roadmap #
- β Rich push-style notifications (image, large icon)
- β Persistent notification badge widget
- β Swipe-right to mark as actioned
- β Cross-session history persistence (SharedPreferences)
- β Notification grouping collapse UI
π€ Contributing #
Contributions, issues, and feature requests are welcome!
- Fork the repo
- Create your feature branch:
git checkout -b feat/amazing-feature - Commit:
git commit -m 'feat: add amazing feature' - Push:
git push origin feat/amazing-feature - Open a pull request
π License #
MIT License Β© 2025 Mysterious Coder