FLUTTER ECOSYSTEM

LanarsInc/top-snackbar-flutter

आधुनिक यूआई स्नैकबार विजेट

top-snackbar-flutter प्रोजेक्ट कवर
Stars
163
Forks
63
अंतिम पुश (UTC)
3 अग॰ 2026
प्रोजेक्ट स्थिति
सक्रिय
LANARS GitHub avatar
भाषाएँDartRubySwiftKotlinObjective-C

तकनीकी विषय

इस रिपॉज़िटरी के पैकेज

उपयोग की गई निर्भरताएँ

निर्भरता सूची 2 आइटम
  • flutter{"sdk":"flutter"}
  • flutter_testडेवलपमेंट{"sdk":"flutter"}

मूल README

यह अंग्रेज़ी मूल स्नैपशॉट है। नवीनतम सामग्री GitHub पर देखें।

README खोलें / बंद करें

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.

https://raw.githubusercontent.com/LanarsInc/top-snackbar-flutter/main/example/assets/top-snackbar-example.gif

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"),
),