搜索插件、代码仓与 APP 分类

插件详情v0.1.5

ff_navigation_bar

可配置的底部导航栏,带有突出显示和阴影

近 30 天下载
116
喜欢数
159
Pub 分数
40

安装插件

flutter pub add ff_navigation_bar

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个可自定义的 Flutter 底部导航栏,具有突出的高亮和微妙的阴影,以增强视觉深度。设计灵活且易于集成,允许开发者自定义导航项的外观和行为。该包支持平滑过渡,并提供现代美学,适用于需要直观底部导航的移动应用程序。非常适合多个部分或标签页的应用程序,其中用户体验和视觉清晰度是优先考虑的因素。

适合场景

  • 移动应用底部导航
  • 标签式界面设计
  • 可自定义的导航栏
  • 增强的UI,带有阴影
  • 现代应用程序美学

主要特点

  • 突出高亮效果
  • 微妙的阴影样式
  • 高度可配置
  • 平滑过渡
  • 轻松集成

适合对象

  • 寻求现代导航的 Flutter 开发人员
  • 包含多个内容部分的应用程序
  • 注重设计的移动应用
  • 自定义UI实现
  • 需要视觉深度的项目

使用建议

  • 有限的平台特定自定义
  • 除了过渡效果外,没有内置动画
  • 需要手动处理状态管理
  • 未针对复杂的嵌套导航进行优化
  • 依赖外部样式以实现完全自定义

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

ff_navigation_bar

A highly configurable navigation bar with emphasis for the selected item.

Add dependency

dependencies:
  ff_navigation_bar: ^0.1.5

Basic use

import 'package:flutter/material.dart';
import 'package:ff_navigation_bar/ff_navigation_bar.dart';
...
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'Demonstration',
            ),
          ],
        ),
      ),
      bottomNavigationBar: FFNavigationBar(
        theme: FFNavigationBarTheme(
          barBackgroundColor: Colors.white,
          selectedItemBorderColor: Colors.yellow,
          selectedItemBackgroundColor: Colors.green,
          selectedItemIconColor: Colors.white,
          selectedItemLabelColor: Colors.black,
        ),
        selectedIndex: selectedIndex,
        onSelectTab: (index) {
          setState(() {
            selectedIndex = index;
          });
        },
        items: [
          FFNavigationBarItem(
            iconData: Icons.calendar_today,
            label: 'Schedule',
          ),
          FFNavigationBarItem(
            iconData: Icons.people,
            label: 'Contacts',
          ),
          FFNavigationBarItem(
            iconData: Icons.attach_money,
            label: 'Bills',
          ),
          FFNavigationBarItem(
            iconData: Icons.note,
            label: 'Notes',
          ),
          FFNavigationBarItem(
            iconData: Icons.settings,
            label: 'Settings',
          ),
        ],
      ),
    );

Theme

The navbar has a Theme class which can be used to define the majority of appearance settings for the navbar and its items.

  • barBackgroundColor: The background color for the entire bar (default = white)
  • selectedItemBackgroundColor: The background color for the CircleAvatar widget used to display the selected item's icon (default = blueAccent)
  • selectedItemIconColor: The color for the selected item's icon (default = white)
  • selectedItemLabelColor: The color for the selected item's label (default = black)
  • selectedItemBorderColor: The color for the selected item's border (default = white)
  • unselectedItemBackgroundColor: The background color for unselected items (default = transparent)
  • unselectedItemIconColor: The color for unselected items' icons (default = grey)
  • unselectedItemLabelColor: The color for unselected items' icons (default = grey)
  • selectedItemTextStyle: The text style to use for the selected item's label. The selectedItemLabelColor takes priority over any color attribute of the style (defaults to size = 13.0, weight = Bold)
  • unselectedItemTextStyle: The text style to use for the unselected items' labels (defaults to size = 12.0, weight = Normal)
  • barHeight: The height for the bar (which is automatically included within a SafeArea widget)
  • itemWidth: The width to use for the selected item CircleAvater (default = 48.0)
  • showSelectedItemShadow: Indicates if the drop shadow below the selected item should be displayed (default = true)

FFNavigationBar Attributes

  • selectedIndex: The item number (zero indexed) which should be marked as selected
  • onSelectTab: Callback function to receive tap notifications using the typedef Function(int selectedIndex)
  • items: List of FFNavigationBarItem objects to be displayed as the bar's items
  • theme: A FFNavigationBarTheme theme object

FFNavigationBarItem

  • label: The String to display as the item's label
  • iconData: The IconData to use in the item's Icon
  • animationDuration: A Duration object which can be used to tweak the AnimatedContainer behaviour of the navigation bar item.
  • selectedBackgroundColor: A Color value which can override the theme's selectedItemBackgroundColor value for a specific navigation bar item (used to create different colors for each item)
  • selectedForegroundColor: A Color value which can override the theme's selectedItemIconColor value
  • selectedLabelColor: A Color value which can override the theme's selectedItemLabelColor value

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目