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

cupertino_sidebar 封面
套件詳情v1.0.1

cupertino_sidebar

為 Flutter 帶來 iOS 風格的側邊欄和浮動標籤欄,為您的應用提供流暢、原生的 iPadOS 風格導航體驗。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
629
喜歡數
63
Pub 分數
150

安裝套件

flutter pub add cupertino_sidebar

套件介紹

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

cupertino_sidebar 套件透過提供 iOS 風格的側邊欄與浮動標籤列,增強了 Flutter 應用程式體驗,帶來原生 iPadOS 相似導航感受。專為希望在多個平台複製蘋果簡潔介面的開發者設計,此套件可無縫整合至 Android、iOS、Web、macOS、Windows 與 Linux 的 Flutter 專案中。憑藉直覺的手勢操作與響應式佈局,支援緊湊與展開兩種側邊欄模式,非常適合生產力與內容豐富的應用程式。該套件輕量且易於實作,符合 Cupertino 設計原則。

適用情境

  • iPadOS 風格的應用程式導航
  • 具有側邊欄的生產力應用
  • 內容管理介面
  • 桌面端的多窗格佈局
  • 面向蘋果生態系統用戶的App

主要特色

  • iOS 風格的浮動標籤欄
  • 響應式側邊欄佈局
  • 支援所有主要平台
  • 手勢驅動的導航
  • 庫比蒂諾設計合規性
  • 緊湊模式和展開模式

適合對象

  • 面向iPadOS使用者的開發者
  • 需要多窗格導航的應用
  • 尋求原生 iOS 美學的設計師
  • 跨平台桌面應用程式
  • 強調可用性的Flutter專案

使用建議

  • 最適合大螢幕
  • 可能需要在小型設備上調整佈局
  • 超出Cupertino風格的自訂功能有限
  • 不適合傳統的僅行動應用程式

原始 README

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

Cupertino Sidebar

cupertino_sidebar brings iOS-style sidebars and floating tab bars to Flutter, providing a sleek, native feel for iPadOS-style navigation in your app.

Features

Cupertino Sidebar

Cupertino Sidebar

A iOS-style sidebar that can be used to navigate through your app.

Cupertino Floating Tab Bar

Cupertino Floating Tab Bar

A iPadOS-style floating tab bar that can also be used to navigate through your app.

📖 Usage

Sidebar

The CupertinoSidebar works very similar to Flutter's NavigationDrawer. It accepts a list of destinations, a selected index, and a callback function triggered when a destination is tapped.

CupertinoSidebar(
  selectedIndex: _selectedIndex,
  onDestinationSelected: (value) {
    setState(() {
      // Update the selected index when a destination is selected.
      _selectedIndex = value;
    });
  },
  children: [
    // index 0
    SidebarDestination(
      icon: Icon(CupertinoIcons.home),
      label: Text('Home'),
    ),
    // index 1
    SidebarDestination(
      icon: Icon(CupertinoIcons.person),
      label: Text('Items'),
    ),
    // index 2
    SidebarDestination(
      icon: Icon(CupertinoIcons.search),
      label: Text('Search'),
    ),
  ],
);

CupertinoSidebar also supports expandable sections, allowing you to group destinations.

...
children: [
    ...
   SidebarSection(
      label: Text('My section'),
      children: [
        SidebarDestination(
          icon: Icon(CupertinoIcons.settings),
          label: Text('Settings'),
        ),
        ...
      ],
    ),
]

For a full example, see the Sidebar example.

Floating Tab Bar

The CupertinoFloatingTabBar is managed by a TabController, with options to add tabs and specify a callback function.

CupertinoFloatingTabBar(
  onDestinationSelected: (value) {},
  controller: _myTabController,
  tabs: const [
    CupertinoFloatingTab(
      child: Text('Today'),
    ),
    CupertinoFloatingTab(
      child: Text('Library'),
    ),
    CupertinoFloatingTab.icon(
      icon: Icon(CupertinoIcons.search),
    ),
  ],
)

For a full example, see the Tab Bar example.

Additional examples

📅 Roadmap

This package is actively being developed. Planned features include:

  • Tab bar to sidebar transition
  • Adaptive scaffold that switches between a sidebar and a floating tab bar and a bottom tab bar depending on the screen size.

🤝 Contributing

Contributions are welcome! Feel free to submit issues, ideas, or pull requests. Together, we can make cupertino_sidebar even better!

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。