搜尋套件、儲存庫與 APP 分類

curved_navigation_bar 封面
套件詳情v1.0.6

curved_navigation_bar

驚人的動態彎曲形狀導航列。可調節顏色、背景色、動畫曲線和動畫持續時間。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1.6萬
喜歡數
2100
Pub 分數
160

安裝套件

flutter pub add curved_navigation_bar

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個視覺上吸引人、帶有動畫效果的曲線導航列,適用於Flutter應用。它提供可自定義的顏色、背景色調、動畫曲線和持續時間設定,以創造動態且現代的底端導航體驗。非常適合尋求獨特、流暢介面並實現標籤間平滑過渡的應用程式。該套件支援多個平台,包括Android、iOS、Web、macOS、Windows和Linux。

適用情境

  • 自定義應用介面
  • 現代用戶介面設計
  • 動畫底部導航
  • 跨平台移動應用
  • 互動式標籤切換
  • 增強的使用者體驗

主要特色

  • 可動畫的曲線形狀
  • 可自定顏色
  • 可調節動畫曲線
  • 可設定的動畫持續時間
  • 多平台支援
  • 平滑過渡效果

適合對象

  • 注重設計的Flutter開發者
  • 需要唯一導航的應用程式
  • 具有現代UI美學的專案
  • 跨平台應用程式建構工具
  • 想要動畫組件的開發者

使用建議

  • 可能影響低階裝置的效能
  • 超出視覺屬性之外的自訂功能有限
  • 需要在各個平台上進行仔細測試
  • 動畫可能不適合所有應用風格
  • 不太適合簡單的導航需求

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

curved_navigation_bar

pub package

A Flutter package for easy implementation of curved navigation bar.

Gif

Add dependency
dependencies:
  curved_navigation_bar: ^1.0.6 #latest version
Easy to use
Scaffold(
  bottomNavigationBar: CurvedNavigationBar(
    backgroundColor: Colors.blueAccent,
    items: <Widget>[
      Icon(Icons.add, size: 30),
      Icon(Icons.list, size: 30),
      Icon(Icons.compare_arrows, size: 30),
    ],
    onTap: (index) {
      //Handle button tap
    },
  ),
  body: Container(color: Colors.blueAccent),
)
Attributes

items: List of Widgets
index: index of NavigationBar, can be used to change current index or to set initial index
color: Color of NavigationBar, default Colors.white
buttonBackgroundColor: background color of floating button, default same as color attribute
backgroundColor: Color of NavigationBar's background, default Colors.blueAccent
onTap: Function handling taps on items
animationCurve: Curves interpolating button change animation, default Curves.easeOutCubic
animationDuration: Duration of button change animation, default Duration(milliseconds: 600)
height: Height of NavigationBar, min 0.0, max 75.0
maxWidth: Allows to set the width of the navigation bar lower than the entire screen width by default
letIndexChange: Function which takes page index as argument and returns bool. If function returns false then page is not changed on button tap. It returns true by default\

Change page programmatically
 //State class
  int _page = 0;
  GlobalKey<CurvedNavigationBarState> _bottomNavigationKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        bottomNavigationBar: CurvedNavigationBar(
          key: _bottomNavigationKey,
          items: <Widget>[
            Icon(Icons.add, size: 30),
            Icon(Icons.list, size: 30),
            Icon(Icons.compare_arrows, size: 30),
          ],
          onTap: (index) {
            setState(() {
              _page = index;
            });
          },
        ),
        body: Container(
          color: Colors.blueAccent,
          child: Center(
            child: Column(
              children: <Widget>[
                Text(_page.toString(), textScaleFactor: 10.0),
                ElevatedButton(
                  child: Text('Go To Page of index 1'),
                  onPressed: () {
                    //Page change using state does the same as clicking index 1 navigation button
                    final CurvedNavigationBarState? navBarState =
                        _bottomNavigationKey.currentState;
                    navBarState?.setPage(1);
                  },
                )
              ],
            ),
          ),
        ));
  }

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案