FLUTTER ECOSYSTEM

LanarsInc/top-snackbar-flutter

현대적인 UI 스낵바 위젯

top-snackbar-flutter 프로젝트 이미지
Stars
163
Forks
63
최근 푸시(UTC)
2026. 8. 3.
프로젝트 상태
활성
LANARS GitHub avatar
GITHUB Organization

LANARS ↗

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