Muhammad Luqman
ย ยทย FlutterFlow Expert | Flutter | OpenAI | Software Engineer

๐Ÿš€ Custom Toast Notification in FlutterFlow

Future customToast(BuildContext context, String title, String subTitle) async {
  toastification.show(
    context: context, // optional if you use ToastificationWrapper
    type: ToastificationType.success,
    style: ToastificationStyle.fillColored,
    autoCloseDuration: const Duration(seconds: 5),
    showIcon: false,
    title: Text(
      subTitle,
      style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
    ),
    // you can also use RichText widget for title and description parameters

    alignment: Alignment.topRight,
    animationDuration: const Duration(milliseconds: 300),
    primaryColor: FlutterFlowTheme.of(context).primary,
    padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16),
    margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
    borderRadius: BorderRadius.circular(12),
    showProgressBar: false,
  );
}

The customToast action displays a sleek and modern toast notification using the toastification โ€” Perfect for giving users a clean success message experience in your app.

๐Ÿ”ง Takes 2 Parameters:

  • ๐Ÿท๏ธ title โ€“ (Displayed as the title of the toast message)

  • ๐Ÿ’ฌ subTitle โ€“ (Displayed as the main toast message)

โœจ Features:

  • โœ… Success-style toast

  • ๐ŸŽจ Themed background color from FlutterFlowTheme

  • ๐Ÿ•’ Auto-dismisses after 5 seconds

  • ๐ŸŽฌ Smooth 300ms animation

  • ๐Ÿ“ Appears top-right

  • โŒ No icon or progress bar

  • ๐ŸงŠ Clean layout with rounded corners and padding

๐Ÿ“ฆ Make sure to add the toastification package in your pubspec.yaml.

๐Ÿ› ๏ธ You can customize the toast according to your requirement โ€” change the type, style, duration, alignment, and more!

If you found this helpful, please like, comment, and share! ๐Ÿ‘๐Ÿ’ฌ๐Ÿ”
If you need any assistance or want to build your product, DM me! ๐Ÿ’ฌ
Thank you!

7