搜尋套件、儲存庫與 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.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。