FLUTTER ECOSYSTEM

datvu7/flutter_colorful_tab

一个色彩丰富的 TabBar Flutter 库,带有颜色动画指示器,每个标签都有自己的颜色。(受 SmartNews 应用启发)

flutter_colorful_tab 项目封面
Stars
18
Forks
9
最近推送(UTC)
2024年4月16日
项目状态
未归档
datvu7 GitHub avatar
GITHUB User

datvu7 ↗

语言DartC++CMakeHTMLSwiftCKotlinObjective-C

技术话题

使用的依赖

依赖清单 2 项
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 README

Flutter Colorful TabBar

A colorful TabBar for Flutter where each tab has a color (inspired by SmartNews app).

demo

Getting Started

Add this to your package's pubspec.yaml file:

  dependencies:
    flutter_colorful_tab: {current_version}

Import the library in your file:

import 'package:flutter_colorful_tab/flutter_colorful_tab.dart';

Use the flutter_colorful_tab like this:

ColorfulTabBar(
  tabs: [
    TabItem(color: Colors.red, title: Text('Home')),
    TabItem(color: Colors.green, title: Text('Favorite')),
    TabItem(color: Colors.orange, title: Text('Search')),
    TabItem(color: Colors.green, title: Text('Settings')),
  ],
  controller: _tabController,
)

// all available parameters of TabItem
  TabItem(
    color: Colors.orange,
    unselectedColor: Colors.orange.shade600,
    title: const Text('Search'),
    labelColor: Colors.black,
    unselectedLabelColor: Colors.yellow,
    labelStyle: const TextStyle(fontWeight: FontWeight.bold),
    unselectedLabelStyle: const TextStyle(fontWeight: FontWeight.normal),
  ),