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

custom_line_indicator_bottom_navbar 封面
插件详情v0.0.8

custom_line_indicator_bottom_navbar

一个完全可自定义的底部导航栏,带有顶部和底部指示器以及渐变效果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
132
喜欢数
28
Pub 分数
150

安装插件

flutter pub add custom_line_indicator_bottom_navbar

插件介绍

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

一个高度可定制的底部导航栏,支持渐变的顶部和底部指示器。专为寻求跨多个平台现代、视觉丰富的导航体验的开发者设计。该包允许对指示器的颜色、形状、动画和位置进行精细控制,从而实现独特的UI设计。它可无缝集成到Flutter应用中,并支持所有主要平台,包括Android、iOS、Web、macOS、Windows和Linux。

适合场景

  • 带有视觉反馈的自定义应用导航
  • 创建带有渐变的品牌底部栏
  • 通过动画指示器提升用户体验
  • 构建多平台应用程序
  • 设计现代移动和网络界面

主要特点

  • 完全可自定义的指标
  • 顶部和底部均支持渐变
  • 标签之间的动画过渡
  • 跨平台兼容性
  • 可配置的颜色和形状
  • 平滑滚动和轻触交互

适合对象

  • Flutter 开发人员构建现代 UI
  • 注重设计的应用程序需要自定义导航
  • 针对多个平台的应用
  • 希望对底部导航外观进行精细控制的开发者

使用建议

  • 需要理解 Flutter 布局原理
  • 可能需要为复杂主题添加额外的样式
  • 大量动画带来的性能影响
  • 除了基本设置外,文档有限
  • 最适合包含3-6个导航项的应用程序

原始 README

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

custom_line_indicator_bottom_navbar

A fully customizable bottom navigation bar with line indicators and gradient.

alert2 alert2

Usage without gradient:

        class MyExample extends StatefulWidget {
        @override
        _MyExampleState createState() => _MyExampleState();
        }

        class _MyExampleState extends State<MyExample> {
        int _selectedIndex = 0; //default index

        List<Widget> _widgetOptions = [
            Text('Home'),
            Text('Account'),
            Text('Leaves'),
            Text('Loyalty'),
            Text('Requests'),
        ];
        @override
        Widget build(BuildContext context) {
            return Scaffold(
            appBar: AppBar(
                title: Text('Example'),
            ),
            body: Center(
                child: _widgetOptions.elementAt(_selectedIndex),
            ),
            bottomNavigationBar: CustomLineIndicatorBottomNavbar(
                selectedColor: Colors.blue,
                unSelectedColor: Colors.black54,
                backgroundColor: Colors.white,
                currentIndex: _selectedIndex,
                onTap: (index) {
                setState(() {
                    _selectedIndex = index;
                });
                },
                enableLineIndicator: true,
                lineIndicatorWidth: 3,
                indicatorType: IndicatorType.Top,
                // gradient: LinearGradient(
                //   colors: kGradients,
                // ),

                customBottomBarItems: [
                CustomBottomBarItems(
                    label: 'Home',
                    icon: Icons.home,
                ),
                CustomBottomBarItems(
                    label: 'Account',
                    icon: Icons.account_box_outlined,
                ),
                CustomBottomBarItems(
                    label: 'Leaves', icon: Icons.calendar_today_outlined),
                CustomBottomBarItems(
                    label: 'Loyalty',
                    icon: Icons.card_giftcard_rounded,
                ),
                CustomBottomBarItems(
                    label: 'Requests',
                    icon: Icons.list,
                ),
                ],
            ),
            );
        }
        }

Usage with gradient :

class MyExample extends StatefulWidget {

    @override
    _MyExampleState createState() => _MyExampleState();
}

class _MyExampleState extends State<MyExample> {
    int _selectedIndex = 0; //default index

    List<Widget> _widgetOptions = [
        Text('Home'),
        Text('Account'),
        Text('Leaves'),
        Text('Loyalty'),
        Text('Requests'),
    ];
    @override
    Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
            title: Text('Example'),
        ),
        body: Center(
            child: _widgetOptions.elementAt(_selectedIndex),
        ),
        bottomNavigationBar: CustomLineIndicatorBottomNavbar(
        selectedColor: Colors.white,
        unSelectedColor: Colors.black54,
        backgroundColor: Colors.white,
        currentIndex: _selectedIndex,
        onTap: (index) {
            setState(() {
            _selectedIndex = index;
            });
        },
        enableLineIndicator: true,
        lineIndicatorWidth: 3,
        indicatorType: IndicatorType.Top,
        gradient: LinearGradient(
            colors: [Colors.pink, Colors.yellow],
        ),
        customBottomBarItems: [
            CustomBottomBarItems(
                label: 'Home',
                icon: Icons.home,
            ),
            CustomBottomBarItems(
                label: 'Account',
                icon: Icons.account_box_outlined,
            ),
            CustomBottomBarItems(
                label: 'Leaves', icon: Icons.calendar_today_outlined),
            CustomBottomBarItems(
                label: 'Loyalty',
                icon: Icons.card_giftcard_rounded,
            ),
            CustomBottomBarItems(
                label: 'Requests',
                icon: Icons.list,
            ),
        ],
        ),
    );
    }
}

所属分类

源码仓库

使用此插件的项目

暂无相关数据。