flutter_sliding_toast 1.0.1
flutter_sliding_toast: ^1.0.1 copied to clipboard
A flutter sliding toast for displaying messages.
Flutter Sliding Toast #
A flutter sliding toast for displaying message.
🎨 Screenshot #
🎯 Features #
- Slide the toast from all direction
- Stick the toast at a position with alignment
- Define sliding and display duration
- Define max height and width
- Set title and trailing widgets
- Disable progressbar indicator
- Customize styles and animation behavior
- Use default success and error toast
- Dismiss toast with gesture
⚙️ Getting Started #
Add the following line to pubspec.yaml:
dependencies:
flutter_sliding_toast: ^1.0.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.",
style: TextStyle(),
),
trailing: const Icon(Icons.person, color: Colors.deepPurple),
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: