Skip to content

Forumbit/your_snackbar

Repository files navigation

🍫 Your SnackBar

Your SnackBar is a customizable Snackbar widget for Flutter that lets you create beautiful animations and flexible notification styles.


🚀 Usage

Add the showYourSnackbar function to display a Snackbar with any content:

onPressed: () => showYourSnackbar(
  context,
  child: const Padding(
    padding: EdgeInsets.all(8.0),
    child: Row(
      mainAxisSize: MainAxisSize.min,
      children: [
        Icon(Icons.airplane_ticket, color: Colors.white),
        SizedBox(width: 20),
        Flexible(
          child: Text(
            'Ticket Added',
            style: TextStyle(color: Colors.white),
          ),
        ),
      ],
    ),
  ),
),

🎨 Styles

You can use predefined styles or customize your own:

✅ Success

style: YourSnackbarStyle.success(context),

❌ Error

style: YourSnackbarStyle.error(context),

⚙️ Custom

style: YourSnackbarStyle(
  contentDecoration: const BoxDecoration(),
  contentPadding: const EdgeInsets.symmetric(),
  showContentCurve: Curves.ease,
  hideContentCurve: Curves.bounceIn,
),

Other features

  • You can also set the isPersistent property to true to keep the content in place until it’s swiped away.
  • You can control when the snackbar should hide with duration property

🧩 Animation Example

Video Frame

📄 License

This project is licensed under the MIT License.

About

Snackbar with customizable feature

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published