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

curved_nav_bar 封面
插件详情v0.1.0

curved_nav_bar

带 FAB 的底部导航栏,您可以将 FAB 用作中间标签,或执行其他操作,例如打开弹出窗口或打开相机。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
466
喜欢数
33
Pub 分数
160

安装插件

flutter pub add curved_nav_bar

插件介绍

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

CurvedNavBar 是一个 Flutter 包,提供可自定义的曲线设计底部导航栏,带有位于中心的浮动操作按钮(FAB)。FAB 可作为中间标签使用,或触发打开弹窗、启动相机等操作。支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,提供流畅的动画和响应式布局。适用于需要优雅现代导航体验及交互元素的应用。

适合场景

  • 移动应用导航
  • 增强的底部标签栏,带浮动操作按钮
  • 相机或弹出触发器
  • 跨平台 UI 一致性
  • 现代应用设计
  • 交互式导航手势

主要特点

  • 弯曲的底部导航
  • 可自定义的浮动操作按钮位置
  • 对多个平台的支持
  • 流畅的动画
  • 可扩展的操作处理
  • 响应式设计

适合对象

  • 寻求现代 UI 的开发人员
  • 需要交互式浮动操作按钮的应用
  • 跨平台移动应用
  • 注重设计的 Flutter 项目
  • 想要动画导航栏的用户

使用建议

  • 需要仔细的布局规划
  • 可能需要自定义样式来实现复杂的设计
  • 仅限底部导航使用场景
  • 平台特定的行为可能会有所不同
  • 不适用于非底部导航场景
  • FAB 交互逻辑必须单独实现

原始 README

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

curved_nav_bar

Bottom nav bar with FAB and center text, You can use FAB as a middle tab or perform other operations like, open popup or open camera (pub.dev).

Screenshots

Usage

Example

To use this package :

dependencies:
   flutter:
     sdk: flutter
   curved_nav_bar:

Getting started

To start, import the dependency in your code:

import 'package:curved_nav_bar/curved_bar/curved_action_bar.dart';
import 'package:curved_nav_bar/fab_bar/fab_bottom_app_bar_item.dart';
import 'package:curved_nav_bar/flutter_curved_bottom_nav_bar.dart';

The following options are available for CurvedNavBar:

Property Type Description
appBarItems List List of FABBottomAppBarItem,length of appBarItems should be equal to the length of bodyItems
bodyItems List List of Widget,length of bodyItems should be equal to the length of appBarItems
extendBody bool extendBody default value always true
actionButton CurvedActionBar Typically a FloatingActionButton
activeColor Color Color of selected tab activeColor default value always Colors.black
inActiveColor Color Color of unselected tab inActiveColor default value always Colors.black26
navBarBackgroundColor Color background Color of navigation bar navBarBackgroundColor default value always Colors.white
actionBarView Widget Set as scaffold body when actionButton selected

Options for FABBottomAppBarItem are:

Property Type Description
activeIcon Widget selected icon of navigation bar item
inActiveIcon Widget unselected icon of navigation bar item
text String label of navigation bar item

Options for CurvedActionBar are:

Property Type Description
activeIcon Widget selected icon for actionButton
inActiveIcon Widget unselected icon of actionButton
text String text label for actionButton
onTab ValueChanged return bool value when tab on actionButton
How to use
import 'package:flutter/material.dart';
import 'package:curved_nav_bar/curved_bar/curved_action_bar.dart';
import 'package:curved_nav_bar/fab_bar/fab_bottom_app_bar_item.dart';
import 'package:curved_nav_bar/flutter_curved_bottom_nav_bar.dart';
void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return CurvedNavBar(
      actionButton: CurvedActionBar(
          onTab: (value) {
            /// perform action here
            print(value);
          },
          activeIcon: Container(
            padding: EdgeInsets.all(8),
            decoration:
                BoxDecoration(color: Colors.white, shape: BoxShape.circle),
            child: Icon(
              Icons.camera_alt,
              size: 50,
              color: Colors.orange,
            ),
          ),
          inActiveIcon: Container(
            padding: EdgeInsets.all(8),
            decoration:
                BoxDecoration(color: Colors.white70, shape: BoxShape.circle),
            child: Icon(
              Icons.camera_alt_outlined,
              size: 50,
              color: Colors.orange,
            ),
          ),
          text: "Camera"),
      activeColor: Colors.blue,
      navBarBackgroundColor: Colors.limeAccent,
      inActiveColor: Colors.black45,
      appBarItems: [
        FABBottomAppBarItem(
            activeIcon: Icon(
              Icons.home,
              color: Colors.blue,
            ),
            inActiveIcon: Icon(
              Icons.home,
              color: Colors.black26,
            ),
            text: 'Home'),
        FABBottomAppBarItem(
            activeIcon: Icon(
              Icons.wallet_giftcard,
              color: Colors.blue,
            ),
            inActiveIcon: Icon(
              Icons.wallet_giftcard,
              color: Colors.black26,
            ),
            text: 'Wallet'),
      ],
      bodyItems: [
        Container(
          height: MediaQuery.of(context).size.height,
          color: Colors.blue,
        ),
        Container(
          height: MediaQuery.of(context).size.height,
          color: Colors.pinkAccent,
        )
      ],
      actionBarView: Container(
        height: MediaQuery.of(context).size.height,
        color: Colors.orange,
      ),
    );
  }
}

Pull Requests

Pull requests are most welcome. It usually will take me within 24-48 hours to respond to any issue or request.

  1. Please keep PR titles easy to read and descriptive of changes, this will make them easier to merge :)
  2. Pull requests must be made against develop branch. Any other branch (unless specified by the maintainers) will get rejected.
Created & Maintained By

Boffin Coders Pvt. Ltd.

If you found this project helpful or you learned something from the source code and want to thank me, consider buying me a cup of :coffee:

License

Copyright 2018 Boffin Coders Pvt. Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。