An alert toast package to show snackbar easily. This package helps you to render a dynamic alert toast in your Flutter app
This package supports usage on both Android and iOS builds.
Add toasty_snackbar
as a dependency in your pubspec.yaml file
toasty_snackbar: ^0.0.1
Import the library in your dart file
import 'package:toasty_snackbar/toasty_snackbar.dart';
@override
Widget build(BuildContext context) {
String title = "Alert Test Title";
String message =
"Lorem ipsum dolor sit amet. Qui quos perferendis qui harum voluptatem a dolorum minima est voluptas veritatis. Nam commodi unde quo adipisci itaque sed autem veritatis est mollitia quam. Est delectus ipsum et beatae quasi ea molestias voluptatibus quo Quis culpa ut atque consequatur sit explicabo iste ea natus cumque. Aut quia aliquam 33 nostrum tempora et voluptates quia.";
return Center(context.showToastySnackbar(title, message, AlertType.info);
);
}
}
or you can trigger with button
ElevatedButton(
onPressed: () {
context.showToastySnackbar(title, message, AlertType.success);
},
child: const Text("Show Snackbar: Success"),
)
Check examples