搜尋套件、儲存庫與 APP 分類

top_snackbar_flutter 封面
套件詳情v3.5.0

top_snackbar_flutter

頂部訊息欄套件是為了以美觀且方便的方式通知使用者發生了什麼事而設計的。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
4.7萬
喜歡數
531
Pub 分數
160

安裝套件

flutter pub add top_snackbar_flutter

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

Top Snackbar Flutter 是一個通知套件,專門設計用於在螢幕頂部傳遞乾淨、使用者友善的回饋訊息。它提供一種簡單且可自訂的方式,讓使用者了解操作、狀態或事件,而不會打擾他們的工作流程。此套件在整合時特別考量易用性,支援 Android、iOS、Web、macOS、Windows 與 Linux 等多個平台。該套件透過提供順暢的動畫與跨裝置一致的樣式來提升使用者體驗。非常適合需要立即、非干擾式回饋的應用程式。

適用情境

  • 顯示操作確認
  • 顯示錯誤或成功訊息
  • 提供即時狀態更新
  • 增強互動過程中的用戶反饋
  • 通知使用者後台進程結果

主要特色

  • 頂部對齊的通知
  • 可自定義的外觀和持續時間
  • 跨平台相容性
  • 流暢的動畫
  • 簡單 API 結合
  • 支援深色模式

適合對象

  • 行動和網路應用
  • 需要即時用戶反饋的應用程式
  • 尋求輕量級通知解決方案的開發者
  • 強調乾淨的使用者介面/使用者體驗設計的專案
  • 使用 Flutter 進行多平台部署的團隊

使用建議

  • 僅限頂部定位的snackbar
  • 不支援複雜佈局的內建支援
  • 需要手動處理取消時機
  • 最適合簡短訊息
  • 可能需要額外的樣式以保持品牌一致性

原始 README

以下為關聯原始碼儲存庫的 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.

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

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案