搜索分类、插件与代码仓

插件详情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!

所属分类

源码仓库

使用此插件的项目

暂无相关数据。