flutter_sliding_toast 1.3.0
flutter_sliding_toast: ^1.3.0 copied to clipboard
A flutter package for displaying sliding messages from all direction with custom styling and animation.
Flutter Sliding Toast #
A flutter sliding toast for displaying beautiful messages.
Breaking Changes #
The 1.3.0 version brings some breaking changes.
- 'disableMultiTapping' moved to toast settings from the SlidingToast's 'show' function.
🎨 Screenshot #
🎯 Features #
- Change toast's sliding directions and alignment positions
- Define sliding and display duration, max height and width, padding
- Set title, leading, trailing widgets and disable the progressbar
- Use glassmorphism design or default success and error toast
- Dismiss the toast by sliding it horizontally or vertically
- Dismiss an individual or all toasts programmatically
- Pause the animation with long press and release it to continue
- Execute a function after the toast is tapped or disposed
- Disable Multiple tapping to execute 'onTap' callback only one time
⚙️ Getting Started #
Add the following line to pubspec.yaml:
dependencies:
flutter_sliding_toast: ^1.3.0
🚀 Usage #
class MyHomePage extends StatelessWidget {
const MyHomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Sliding Toast"),
centerTitle: true,
),
body: SafeArea(
child: Center(
child: ElevatedButton(
onPressed: () {
SlidingToast.show(
context,
title: const Text(
"Hi there! I'm a simple toast 😎."
" Dismiss me by sliding downward.",
),
trailing: const TrailingWidget(),
toastSetting: const ToastSetting(
animationDuration: Duration(seconds: 1),
displayDuration: Duration(seconds: 2),
toastStartPosition: ToastPosition.bottom,
toastAlignment: Alignment.bottomCenter,
),
);
},
child: const Text("Show Toast"),
),
),
),
);
}
}
❤️ Additional information #
Pull requests are welcomed!
If you encounter any problems or you have any ideas, feel free to open an issue: