Search packages, repositories and app categories

top_snackbar_flutter cover
Package detailsv3.5.0

top_snackbar_flutter

Top snack bar package was created for nice and convenient way to inform users about what happened.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
46.8K
Likes
531
Pub points
160

Install package

flutter pub add top_snackbar_flutter

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Top Snackbar Flutter is a notification package designed to deliver clean, user-friendly feedback messages at the top of the screen. It provides a simple and customizable way to inform users about actions, states, or events without disrupting their workflow. Built with ease of integration in mind, it supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux. The package enhances UX by offering smooth animations and consistent styling across devices. Ideal for apps needing immediate, non-intrusive feedback.

Use cases

  • Displaying action confirmations
  • Showing error or success messages
  • Providing real-time status updates
  • Enhancing user feedback during interactions
  • Informing users of background process results

Key features

  • Top-aligned notifications
  • Customizable appearance and duration
  • Cross-platform compatibility
  • Smooth animations
  • Simple API integration
  • Support for dark mode

Suitable for

  • Mobile and web applications
  • Apps requiring instant user feedback
  • Developers seeking lightweight toast solutions
  • Projects emphasizing clean UI/UX design
  • Teams using Flutter for multi-platform deployment

Considerations

  • Limited to top-positioned snackbar only
  • No built-in support for complex layouts
  • Requires manual handling of dismissal timing
  • Best suited for brief messages
  • May need additional styling for brand consistency

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

SWUbanner

Made in lanars.com.

pub package

If you need to show the user some information in a nice way, you can use this package. The API is as simple as API for regular Material method showDialog. If you need to use your own widget to display, you can pass it into showTopSnackBar function.

Getting Started

In order to show a CustomSnackBar you need to call a showTopSnackBar function. You can pass there any widget you want but we have a CustomSnackBar for example.

showTopSnackBar(
    Overlay.of(context),
    CustomSnackBar.success(
      message:
          "Good job, your release is successful. Have a nice day",
    ),
);
showTopSnackBar(
    Overlay.of(context),
    CustomSnackBar.info(
      message:
          "There is some information. You need to do something with that",
    ),
);
showTopSnackBar(
    Overlay.of(context),
    CustomSnackBar.error(
      message:
          "Something went wrong. Please check your credentials and try again",
    ),
);

Persistent snackbar

There is a usage example demo example/main.dart

AnimationController localAnimationController;
TapBounceContainer(
    onTap: () {
        showTopSnackBar(
            Overlay.of(context),
            CustomSnackBar.info(
              message: "Persistent SnackBar",
            ),
            persistent: true,
            onAnimationControllerInit: (controller) =>
              localAnimationController = controller,
        );
    },
    child: buildButton(context, "Show persistent SnackBar"),
),
TapBounceContainer(
    onTap: () => localAnimationController.reverse(),
    child: buildButton(context, "Dismiss"),
),

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package