搜尋分類、套件與程式碼儲存庫

套件詳情v0.0.2

scrollable_reorderable_navbar

一個可滾動的底部導航列,當需要顯示超過5個導航項目時。它還允許使用者滑動來變更項目位置,並且可以從導航列中刪除項目。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
15
喜歡數
30
Pub 分數
140

安裝套件

flutter pub add scrollable_reorderable_navbar

套件介紹

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

一個可捲動且可重新排序的底端導覽列,適用於 Flutter,當項目超過五個時會動態調整。使用者可以透過滑動來重新排列項目,並直接從導覽列中刪除。專為具有多個標籤頁的應用程式設計,可在行動與桌面平台上提升操作體驗。此套件支援所有主要平台,包括 Android、iOS、Web、macOS、Windows 與 Linux。結合流暢捲動與基於手勢的重新排序與刪除功能,提供靈活的介面以管理導航項目。

適用情境

  • 超過5個導航項目應用程式
  • 可自定義的底部導航佈局
  • 使用者驅動的標籤頁重新排序
  • 動態導航項目管理
  • 桌面和移動跨平台應用

主要特色

  • 超過 5 個項目時可捲動
  • 滑動重新排序功能
  • 刪除導航項目
  • 跨平台支援(Android、iOS、Web、macOS、Windows、Linux)
  • 流暢的手勢互動

適合對象

  • 需要靈活底部導航欄的開發者
  • 需要動態導航自定義的應用程式
  • 針對多個平台的專案
  • UIs with frequent user interaction on navigation
  • 尋求互動式導航組件的設計人員

使用建議

  • 可能需要額外的狀態管理
  • 不適合靜態導航設定
  • 大型項目列表的性能影響
  • 限制為底部導航佈局
  • 需要仔細處理項目刪除的使用者體驗

原始 README

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

ScrollableReordableNavbar for Flutter

A flutter plugin for create bottom nav bar that can be scrolled when there are than 5 nav items to display. It also let user swipe items position and item can be deleted from the navbar.

Installing:

In your pubspec.yaml

dependencies:
  scrollable_reorderable_navbar: ^0.0.1
import 'package:scrollable_reorderable_navbar/scrollable_reorderable_navbar.dart';


Basic Usage:

    ScrollableReorderableNavBar(
      onItemTap: (arg) {
        setState(() {
          _selectedIndex = arg;
        });
      },
      onReorder: (oldIndex, newIndex) {
        final currItem = _items[_selectedIndex];
        if (oldIndex < newIndex) newIndex -= 1;
          final newItems = [..._items], item = newItems.removeAt(oldIndex);
          newItems.insert(newIndex, item);
        setState(() {
          _items = newItems;
          _selectedIndex = _items.indexOf(currItem);
        });
      },
    items: _items,
    selectedIndex: _selectedIndex,
    onDelete: (index) => setState(() => _items.removeAt(index)),
    deleteIndicationWidget: Container(
      padding: const EdgeInsets.only(bottom: 100),
      child: Align(
        alignment: Alignment.bottomCenter,
        child: Wrap(
          alignment: WrapAlignment.center,
          crossAxisAlignment: WrapCrossAlignment.center,
          direction: Axis.vertical,
          children: [
            Text("Tap on nav item to delete it.",
              style: Theme.of(context).textTheme.bodyText1,
              textAlign: TextAlign.center),
            TextButton(onPressed: () {}, child: const Text("DONE"))
          ],
        ),
      ),
    ),
  )


Custom usage

There are options that let you custom the navbar:\

Properties Description
List<NavBarItem> items Items composing the navbar, every items should have different names
int selectedIndex The index of the selected NavBarItem
ValueChanged<int> onItemTap Which behaviour should have after the user tap on a NavBarItem
ReorderCallback onReorder Which behaviour should have after user swap 2 NavBarItem
Widget deleteIndicationWidget The Widget displayed on top of the delete overlay to show user that he can tap on NavBarItem to delete them
ValueChanged<int> onDelete Which behaviour should have after user delete a NavBarItem
ReorderItemProxyDecorator? proxyDecorator How the widget should look like on a reorder operation
Color backgroundColor Background color of the navbar
Duration duration Duration of the animations
BoxDecoration? decoration Decoration of the entire navbar. You should use either backgroundColor or this one

Additional information

Don't hesitate to suggest any features or fix that will improve the package!

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。