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

flutter_tabbar_lite 封面
套件詳情v0.0.6

flutter_tabbar_lite

FlutterTabBarLite 是一個帶有動畫、水平與垂直功能的自訂標籤欄小工具。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
65
喜歡數
9
Pub 分數
145

安裝套件

flutter pub add flutter_tabbar_lite

套件介紹

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

FlutterTabBarLite 是一個輕量級、可自定義的標籤欄小部件,適用於 Flutter,支援水平與垂直佈局,並具備平滑的動畫效果。設計簡潔且效能出色,為開發者提供了一種在 Android、iOS、Web、macOS、Windows 和 Linux 等多個平台實現動畫標籤切換的便捷方式。該套件透過導航時流暢的視覺反饋提升使用者體驗。非常適合需要直觀標籤式導航、設定簡單且高度彈性的應用程式。

適用情境

  • 移動應用中的簡單標籤導航
  • 緊湊使用者介面的垂直制表符佈局
  • 網頁應用中的動畫標籤切換
  • 儀表板的可自定義標籤樣式
  • 多平台 Flutter 應用中的導航

主要特色

  • 水平和垂直製表符支援
  • 平滑的動畫過渡
  • 輕量且高效
  • 跨平台相容性
  • 與現有 Flutter 專案的輕鬆整合
  • 可自定義的外觀和行為

適合對象

  • 尋求簡單標籤欄解決方案的開發者
  • 需要動畫標籤互動的應用
  • 跨平台 Flutter 應用
  • UI 設計師想要靈活的標籤佈局
  • 專案優先考慮最小依賴

使用建議

  • 僅限基本標籤功能(無進階滑動手勢)
  • 可能需要自定樣式才能實現複雜設計
  • 動畫在不同平台上的表現可能略有差異
  • 不適合高度動態的標籤內容管理
  • 最適合靜態或半靜態標籤結構

原始 README

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

FlutterTabBarLite

A fully customizable and animated tab bar widget for Flutter applications. Designed to make navigation intuitive and visually appealing, this package is perfect for creating modern and dynamic tab interfaces.

FlutterTabBarLite

Features

  • Customizable Titles: Unique titles to each tab.
  • Icon Support: Include prefix and suffix icons for enhanced aesthetics.
  • Scrollable & Fixed Layouts: Choose between scrollable and fixed tab bar layouts.
  • Gradient Backgrounds: Apply gradients for a modern look.
  • Responsive Design: Fully responsive for various screen sizes.
  • Tab Change Callback: Get notified when the user switches tabs.
  • Tab Axis Horizontal & Vertical: Horizontal and Vertical Tabs.

Installation

Add the following to your pubspec.yaml file:

dependencies:
  flutter_tabbar_lite: ^0.0.6

Run the command to fetch the package:

flutter pub get

Usage

FlutterTabBarLite Horizontal Example
import 'package:flutter/material.dart';
import 'package:flutter_tab_bar/flutter_tabbar_lite.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text("FlutterTabBarLite Horizontal Example")),
        body: Column(
          children: [
            FlutterTabBarLite.horizontal(
              scrollable: true,
              titles: const [
                "Home",
                "Profile",
                "Settings",
                "More",
                "Help",
                "About",
                "Contact"
              ],
              gradient: const LinearGradient(
                colors: [Colors.teal, Colors.green],
                begin: Alignment.centerLeft,
                end: Alignment.centerRight,
              ),
              onTabChange: (index) {
                print("Scrollable TabBar - Selected Tab: $index");
              },
            ),
          ],
        ),
      ),
    );
  }
}
Flutter TabBarLite Vertical Example
import 'package:flutter/material.dart';
import 'package:flutter_tab_bar/flutter_tabbar_lite.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text("FlutterTabBarLite Vertical Example")),
        body: Column(
          children: [
            FlutterTabBarLite.vertical(
              itemMargin: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
              titles: const [
                "Home",
                "Profile",
                "Settings",
                "More",
                "Help",
                "About",
                "Contact"
              ],
              gradient: const LinearGradient(
                colors: [Colors.purple, Colors.cyan],
                begin: Alignment.centerLeft,
                end: Alignment.centerRight,
              ),
              onTabChange: (index) {
                print("Selected Tab: $index");
              },
            ),
          ],
        ),
      ),
    );
  }
}

Properties

Property Type Default Value Description
scrollable bool false Enables horizontal scrolling for tabs.
titles List<String> ["Tab 1", "Tab 2"] Titles for each tab.
prefixIcons List<IconData>? null Icons before titles.
suffixIcons List<IconData>? null Icons after titles.
backgroundColor Color? Colors.blue Tab bar background color.
selectedTextColor Color Colors.black87 Color for the selected tab's text.
unselectedItemTextColor Color Colors.white Color for unselected tab's text.
gradient LinearGradient? null Gradient applied to the tab bar.
borderRadius double? 8.0 Border radius for TabBar
itemBorderRadius double? 4.0 Border radius for TabBar Item
itemMargin EdgeInsets? null Margin for TabBar Item
onTabChange Function(int)? null Callback function invoked on tab change.
horizontal constructor null Constructor to use horizontal tab bar
vertical constructor null Constructor to use vertical TabBar

Contributions

Contributions are welcome! Please fork the repository, make changes, and submit a pull request. Refer to the CONTRIBUTING.md for more details.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Developed with ❤️ by Khandakar Amir Hamza
GitHub Profile | Portfolio:amirhamza.com


Example App

Check the example directory for a fully functional implementation. Run it locally using:

cd example
flutter run

Feedback

If you encounter any issues or have suggestions, please create an issue in the GitHub repository.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。