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

套件詳情v1.0.3

bottom_navigation_badge

BottomNavigationBadge 是由 westdabestdb 開發的 Flutter 小部件,允許開發者向底端導航列項目新增通知徽章。

近 30 天下載
254
喜歡數
63
Pub 分數
40

安裝套件

flutter pub add bottom_navigation_badge

套件介紹

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

BottomNavigationBadge 是一個 Flutter 小部件,讓開發者能在底部導航列項目上顯示通知徽章。由 westdabestdb 創建,它透過在導航介面中直覺地顯示未讀訊息或更新,提升使用者體驗。此套件可與現有的底部導航設定無縫整合,並支援自訂徽章外觀樣式。輕量級且專為需要在底部導航列中直覺顯示通知指示器的 Flutter 應用程式設計。

適用情境

  • 顯示未讀訊息數量
  • 突出顯示待處理的操作
  • 增強應用通知的可見性
  • 透過視覺提示提升使用者參與度
  • 按項目自定義徽章外觀

主要特色

  • 與 BottomNavigationBar 的輕鬆整合
  • 支援自定徽章顏色和文字
  • 輕量且專注的功能
  • 動態徽章更新
  • 簡單的徽章管理 API

適合對象

  • 具有底部導航的移動應用
  • 需要即時通知的應用
  • 尋求極簡徽章解決方案的開發者
  • 以UI為中心的Flutter專案
  • 具有多個導航選項卡的應用程式

使用建議

  • 僅限底部導航上下文
  • 無內建動畫支援
  • 需要手動管理徽章狀態
  • 不適用於複雜的徽章版面
  • 依賴於父級 BottomNavigationBar 結構

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

bottom_navigation_badge / BottomNavigationBadge

BottomNavigationBadge is a Flutter class developed by westdabestdb.

Getting Started

Add this to your package's pubspec.yaml file:

...
dependencies:
  bottom_navigation_badge: ^1.0.3

Now in your Dart code, you can use:

import 'package:bottom_navigation_badge/bottom_navigation_badge.dart';

Usage

Initialize the badger. Isn't it a nice variable name lol 😁

BottomNavigationBadge badger = new BottomNavigationBadge(
  backgroundColor: Colors.red,
  badgeShape: BottomNavigationBadgeShape.circle,
  textColor: Colors.white,
  position: BottomNavigationBadgePosition.topRight,
  textSize: 8);

Create a list of BottomNavigationBarItems

List<BottomNavigationBarItem> items = [
  BottomNavigationBarItem(icon: Icon(Icons.home), title: Text("Home")),
  BottomNavigationBarItem(icon: Icon(Icons.notifications), title: Text("Notifications")),
  BottomNavigationBarItem(icon: Icon(Icons.face), title: Text("Profile"))
];

Add badge to index with content "1"

setState(() {
  items = badger.setBadge(items, "1", index);
});

Remove the badge at index

setState(() {
  items = badger.removeBadge(items, index);
});

Remove all the badges

setState(() {
  items = badger.removeAll(items);
});

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。