SnackFlow

Pub.dev License Platform
pub package License: MIT Platform

Features

The SnackFlow Flutter package is a customizable overlay notification system that lets developers show modern, glassmorphic-style snack messages anywhere on the screen. It provides four default methods—show, success, failed, and error—so users can quickly display messages by type, e.g., SnackFlow.success(context, "Profile updated!"). Each method is fully customizable with parameters like title, backgroundColor, textColor, icon, leading widget, duration, borderRadius, position, verticalPosition, action buttons, and a close button.

Features include glassmorphic design with blur, adaptive text color, multiple positions, vertical alignment, optional avatars/icons, action buttons, smooth slide animations, haptic feedback, and auto-dismissal. SnackFlow saves time, improves UX, and is perfect for notifications, alerts, warnings, and confirmations.

Key Methods:

SnackFlow.show(...) – Neutral message

SnackFlow.success(...) – Green success

SnackFlow.failed(...) – Orange warning

SnackFlow.error(...) – Red error

It allows interactive, stylish, and fully customizable notifications effortlessly.

Demo

Demo GIF

Installation

  1. pubspec.yaml
dependencies:
  snackflow: <latest_version>
  1. run flutter pub get in your terminal.

Prerequisites

  • Flutter SDK: >=3.0.0
  • Dart SDK: >=2.18.0

Import

import 'package:snackflow/snackflow.dart';

Quick Usage

  1. Basic show() method.
SnackFlow.show(
  context,
  "Data loaded successfully.",
);
  1. Basic success() method.
SnackFlow.success(
  context,
  "Payment completed. Thank you!",
);


  1. Basic error() method.
SnackFlow.error(
  context,
  "Server connection lost. Please try again.",
);

  1. Basic failed() method.
SnackFlow.failed(
  context,
  "Input verification failed due to an error.",
);


  1. Top Position ( using show() method)
SnackFlow.show(
  context,
  "This notification is visible at the top of the screen.",
  position: SnackPosition.top,
);


  1. Center Position ( using show() method)
SnackFlow.show(
  context,
  "This notification will be shown in the exact center.",
  position: SnackPosition.center,
);


  1. Left Position, Top aligned ( using show() method)
SnackFlow.show(
  context,
  "Left side, aligned to the top.",
  position: SnackPosition.left,
  verticalPosition: VerticalPosition.top,
);


8 Right Position, Middle aligned ( using success() method)

SnackFlow.success(
  context,
  "Right side, aligned to the middle vertically.",
  position: SnackPosition.right,
  verticalPosition: VerticalPosition.middle,
);


9 Action Button Example ( using show() method)

SnackFlow.show(
  context,
  "Do you want to update your profile now?",
  actionLabel: "Update",
  onAction: () {
    ScaffoldMessenger.of(context).showSnackBar(
      const SnackBar(content: Text('Action button clicked!')),
    );
  },
);


10 Leading Widget & Title ( using show() method)

SnackFlow.show(
  context,
  "You have received a new message.",
  leading: const CircleAvatar(
    backgroundColor: Colors.redAccent,
    child: Icon(Icons.mail, color: Colors.white, size: 20),
  ),
  title: "New Message!",
);


11 Custom Colors ( using failed() method)

SnackFlow.failed(
  context,
  "White background and dark blue text.",
  backgroundColor: Colors.white,
  textColor: Colors.blueGrey.shade900,
  duration: const Duration(seconds: 7),
  title: "Custom Look",
);


12 On Dismiss Callback ( using error() method)

SnackFlow.error(
  context,
  "Something will happen when this notification is closed.",
  title: "Timer On",
  duration: const Duration(seconds: 3),
  onDismiss: () {
    ScaffoldMessenger.of(context).showSnackBar(
      const SnackBar(content: Text('Notification dismissed.')),
    );
  },
);


Properties Reference

Method / Property Type Default / Description
show() Method Default/neutral notification
success() Method Green success notification
failed() Method Orange warning/failure
error() Method Red error notification
message String Text to show
backgroundColor Color? Badge color (semi-transparent)
textColor Color? Text/icon color (auto-adjust)
icon IconData? Leading icon
leading Widget? Custom widget
duration Duration Auto-dismiss
borderRadius double Rounded corners (14)
position SnackPosition top/bottom/center/left/right
verticalPosition VerticalPosition For left/right: top/middle/bottom
actionLabel String? Action button text
onAction VoidCallback? Action callback
showClose bool Show close button (true)
onDismiss VoidCallback? On hide callback
title String? Optional title
statusColor Color? Leading/status color

License

This package is released under the MIT License — free for commercial and personal use.

Additional Information

  1. Reporting Issues

    If you encounter any bugs or have feature requests, please feel free to file an issue on the GitHub repository.

  2. Version History

For a complete history of changes, bug fixes, and updates, please refer to the CHANGELOG.md file included in this repository.

Contributing

Contributions are always welcome! You can fork the repository, make your improvements, and submit a pull request. Let’s make this package better together.

Libraries

snackflow