flutter_sliding_toast 1.2.0
flutter_sliding_toast: ^1.2.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 message.
🎨 Screenshot #
🎯 Features #
- Change toast's popup directions and alignment positions
- Define sliding and display duration
- Define max height, width and padding
- Set title, trailing widgets and disable the progressbar
- Use glassmorphism design or default success and error toast
- Dismiss the toast by sliding it horizontally or vertically
- 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 callback only one time
⚙️ Getting Started #
Add the following line to pubspec.yaml:
dependencies:
flutter_sliding_toast: ^1.2.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: