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

motion_tab_bar 封面
套件詳情v2.0.4

motion_tab_bar

適用於 Flutter 應用的動畫底部導航欄,圖示會動態進入位置,顏色可自訂。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
725
喜歡數
261
Pub 分數
140

安裝套件

flutter pub add motion_tab_bar

套件介紹

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

Motion Tab Bar 是一個為 Flutter 設計的動畫底部導航欄,具備順暢的圖示過渡效果與可自訂的顏色。它透過動態動畫提升使用者體驗,在切換標籤時讓導航更具視覺吸引力。此套件支援 Android、iOS、Web、macOS、Windows 及 Linux 多個平台,確保跨裝置設計的一致性。開發者可透過簡單指令輕鬆將其整合至應用程式中。其輕量級特性與彈性樣式選項,使其非常適合現代互動式介面。

適用情境

  • 動畫應用導航
  • 現代移動和網路介面
  • 可自定義的底部導航
  • 增強的使用者參與度
  • 跨平台應用
  • 互動式 UI 組件

主要特色

  • 平滑圖標動畫
  • 可自定顏色
  • 跨平台支援
  • 輕鬆整合
  • 輕量化設計
  • 響應式過渡

適合對象

  • 尋求動畫導航的Flutter開發者
  • 需要視覺反饋的應用程式
  • 注重設計的應用程式
  • 跨平台專案
  • UI/UX優化工作
  • 移動和網頁應用開發者

使用建議

  • 可能影響低階裝置的效能
  • 除了顏色和動畫之外,自訂選項有限
  • 需要在所有目標平台上進行仔細測試
  • 不適合極簡設計
  • 動畫可能會在過度使用時分散使用者的注意力
  • 依賴第三方相依性以實現完整功能

原始 README

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

Motion Tab Bar compatible with Flutter 3 and RTL support

pub package likes popularity pub points

A beautiful animated widget for your Flutter apps

MotionTabBar Gif

Without Badge With Badge
MotionTabBar Gif MotionTabBar Gif

Getting Started

Add the plugin:

dependencies:
  motion_tab_bar: ^2.0.4

Basic Usage

Use default TabController or MotionTabBarController:
  // TabController _tabController;
  MotionTabBarController? _motionTabBarController;

  @override
  void initState() {
    super.initState();
    
    //// Use normal tab controller
    // _tabController = TabController(
    //   initialIndex: 1,
    //   length: 4,
    //   vsync: this,
    // );

    //// use "MotionTabBarController" to replace with "TabController", if you need to programmatically change the tab
    _motionTabBarController = MotionTabBarController(
      initialIndex: 1,
      length: 4,
      vsync: this,
    );
  }

  @override
  void dispose() {
    super.dispose();

    // _tabController.dispose();
    _motionTabBarController!.dispose();
  }
Add Motion Tab Bar to Scaffold bottomNavigationBar:
  bottomNavigationBar: MotionTabBar(
    controller: _motionTabBarController, // ADD THIS if you need to change your tab programmatically
    initialSelectedTab: "Home",
    labels: const ["Dashboard", "Home", "Profile", "Settings"],
    icons: const [Icons.dashboard, Icons.home, Icons.people_alt, Icons.settings],

    // optional badges, length must be same with labels
    badges: [
      // Default Motion Badge Widget
      const MotionBadgeWidget(
        text: '10+',
        textColor: Colors.white, // optional, default to Colors.white
        color: Colors.red, // optional, default to Colors.red
        size: 18, // optional, default to 18
      ),

      // custom badge Widget
      Container(
        color: Colors.black,
        padding: const EdgeInsets.all(2),
        child: const Text(
          '11',
          style: TextStyle(
            fontSize: 14,
            color: Colors.white,
          ),
        ),
      ),

      // allow null
      null,

      // Default Motion Badge Widget with indicator only
      const MotionBadgeWidget(
        isIndicator: true,
        color: Colors.blue, // optional, default to Colors.red
        size: 5, // optional, default to 5,
        show: true, // true / false
      ),
    ],
    tabSize: 50,
    tabBarHeight: 55,
    textStyle: const TextStyle(
      fontSize: 12,
      color: Colors.black,
      fontWeight: FontWeight.w500,
    ),
    tabIconColor: Colors.blue[600],
    tabIconSize: 28.0,
    tabIconSelectedSize: 26.0,
    tabSelectedColor: Colors.blue[900],
    tabIconSelectedColor: Colors.white,
    tabBarColor: Colors.white,
    onTabItemSelected: (int value) {
      setState(() {
        // _tabController!.index = value;
        _motionTabBarController!.index = value;
      });
    },
  ),
add TabBarView to Scaffold body
  body: TabBarView(
    physics: NeverScrollableScrollPhysics(), // swipe navigation handling is not supported
    // controller: _tabController,
    controller: _motionTabBarController,
    children: <Widget>[
      const Center(
        child: Text("Dashboard"),
      ),
      const Center(
        child: Text("Home"),
      ),
      const Center(
        child: Text("Profile"),
      ),
      const Center(
        child: Text("Settings"),
      ),
    ],
  ),
to change tabs programmatically
...

ElevatedButton(
  // set MotionTabBarController index to new tab index
  onPressed: () => _motionTabBarController.index = 0,
  child: const Text('Dashboard Page'),
),
ElevatedButton(
  // set MotionTabBarController index to new tab index
  onPressed: () => _motionTabBarController.index = 1,
  child: const Text('Home Page'),
),

...

Catch me up on LinkedIn @Rezaul Islam

💙 to Code👨🏽‍💻 Flutter Expert • Dart Kotlin Swift Node Js • Android • Full Stack Developer

所屬分類

依賴

依賴清單 1 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。