toaster_common 0.0.2
toaster_common: ^0.0.2 copied to clipboard
A customizable animated overlay toast for Flutter apps.
🚀 Animated Global Toast #
A lightweight, customizable animated overlay toast for Flutter with smooth scale and fade transitions.
✨ Features #
- 🎯 Smooth scale + fade animation
- 📍 Top or Bottom positioning
- 🖼️ Support for asset image, network image, or custom icon
- ⏱️ Auto dismiss
- 👆 Dismiss on tap
- 🎨 Customizable background color
📦 Installation #
Add this to your pubspec.yaml:
dependencies:
animated_global_toast: ^0.0.2
Then run:
flutter pub get
🚀 Basic Usage #
ToastService.show(
context: context,
message: "Success!",
backgroundColor: Colors.green,
);
✅ Success Toast #
ToastService.showSuccess(
context,
"Login Successful",
);
❌ Error Toast #
ToastService.showError(
context,
"Something went wrong",
);
🖼️ Asset Image Toast #
ToastService.show(
context: context,
message: "Custom Toast",
assetImage: "assets/logo.png",
);
⚠️ Make sure the asset is added in your pubspec.yaml.
🌐 Network Image Toast #
ToastService.show(
context: context,
message: "Network Image",
networkImage: "https://example.com/image.png",
);
⚙️ Fully Custom Example #
ToastService.show(
context: context,
message: "Operation Completed",
assetImage: "assets/images/custom_image.png",
backgroundColor: Colors.green,
position: ToastPosition.top,
duration: Duration(seconds: 3),
);
📍 Toast Position Options #
ToastPosition.top
ToastPosition.bottom
📄 License #
MIT License