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

curved_labeled_navigation_bar 封面
套件詳情v2.0.6

curved_labeled_navigation_bar

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

AndroidiOSmacOSWindowsLinux
近 30 天下載
2330
喜歡數
145
Pub 分數
160

安裝套件

flutter pub add curved_labeled_navigation_bar

套件介紹

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

一個視覺上引人注目的、可動畫化的曲線導航列,適用於Flutter應用。它具備平滑的過渡效果,支援自訂顏色、背景色調、動畫曲線與持續時間設定。非常適合重視美學吸引力與使用者參與度的現代UI。此套件支援多個平台,包括Android、iOS、macOS、Windows與Linux,確保跨裝置設計的一致性。其動態動畫提升使用者體驗,同時維持實作上的簡潔性。

適用情境

  • 現代應用程式介面
  • 行動和桌面應用程式
  • 互動式 UI 組件
  • 自定義底部導航欄
  • 增強的使用者體驗

主要特色

  • 可動畫的曲線形狀
  • 可自定顏色
  • 可調節動畫曲線
  • 可設定的動畫持續時間
  • 跨平台支援
  • 標記的導航項目

適合對象

  • 注重設計的開發者
  • 需要視覺魅力的應用程式
  • UI/UX 設計師
  • Flutter 初學者尋找進階小部件
  • 具有自定導航需求的專案

使用建議

  • 可能影響低階裝置的效能
  • 需要仔細考慮顏色對比度以確保可訪問性
  • 動畫設定需要在不同裝置上進行測試
  • 僅限底部導航使用場景
  • 不適合極簡設計

原始 README

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

curved_labeled_navigation_bar

pub package

A Flutter package for easy implementation of curved navigation bar. This package is a fork of the original curved_navigation_bar from https://github.com/rafalbednarczuk/curved_navigation_bar with label for CurvedNavigationBarItem.

Label No Label
Gif Gif
Add dependency
dependencies:
  curved_labeled_navigation_bar: ^2.0.6 #latest version
Easy to use
Scaffold(
  bottomNavigationBar: CurvedNavigationBar(
    backgroundColor: Colors.blueAccent,
    items: [
      CurvedNavigationBarItem(
        child: Icon(Icons.home_outlined),
        label: 'Home',
      ),
      CurvedNavigationBarItem(
        child: Icon(Icons.search),
        label: 'Search',
      ),
      CurvedNavigationBarItem(
        child: Icon(Icons.chat_bubble_outline),
        label: 'Chat',
      ),
      CurvedNavigationBarItem(
        child: Icon(Icons.newspaper),
        label: 'Feed',
      ),
      CurvedNavigationBarItem(
        child: Icon(Icons.perm_identity),
        label: 'Personal',
      ),
    ],
    onTap: (index) {
      // Handle button tap
    },
  ),
  body: Container(color: Colors.blueAccent),
)
Attributes
CurvedNavigationBar
Attribute Description
items List of CurvedNavigationBarItem
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
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
animationCurve Curves interpolating button change animation, default Curves.easeOut
animationDuration Duration of button change animation, default Duration(milliseconds: 600)
height Height of NavigationBar
maxWidth Allows to set the width of the navigation bar lower than the entire screen width by default
iconPadding Padding of icon in floating button
CurvedNavigationBarItem
Attribute Description
child Icon of CurvedNavigationBarItem
label Text of CurvedNavigationBarItem
labelStyle TextStyle for label
Change page programmatically
 // State class
  int _page = 0;
  GlobalKey<CurvedNavigationBarState> _bottomNavigationKey = GlobalKey();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        bottomNavigationBar: CurvedNavigationBar(
          key: _bottomNavigationKey,
          items: [
            CurvedNavigationBarItem(
              child: Icon(Icons.home_outlined),
              label: 'Home',
            ),
            CurvedNavigationBarItem(
              child: Icon(Icons.search),
              label: 'Search',
            ),
            CurvedNavigationBarItem(
              child: Icon(Icons.chat_bubble_outline),
              label: 'Chat',
            ),
            CurvedNavigationBarItem(
              child: Icon(Icons.newspaper),
              label: 'Feed',
            ),
            CurvedNavigationBarItem(
              child: Icon(Icons.perm_identity),
              label: 'Personal',
            ),
          ],
          onTap: (index) {
            setState(() {
              _page = index;
            });
          },
        ),
        body: Container(
          color: Colors.blueAccent,
          child: Center(
            child: Column(
              children: <Widget>[
                Text(_page.toString(), textScaler: TextScaler.linear(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);
                  },
                )
              ],
            ),
          ),
        ),
    );
  }

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。