パッケージ、リポジトリ、アプリカテゴリを検索

flutter_toggle_tab のカバー
パッケージ詳細v2.0.0

flutter_toggle_tab

Flutterで美しいカスタマイズ可能なトグルタブウィジェットを作成するためのライブラリ

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.1万
いいね数
121
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_toggle_tab

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

開発者が視覚的に魅力的で高度にカスタマイズ可能なトグルタブウィジェットを作成できるFlutterパッケージです。滑らかなアニメーションとすべての主要プラットフォームでの応答性のある動作を備えた、柔軟で使いやすいインターフェースを提供します。コンテンツのフィルタリングやビュー間の切り替え、または洗練されたモダンなUIでのオプション選択に最適です。カスタムスタイル、配置、および動的なコンテンツレンダリングをサポートしており、単純な用途から複雑な用途まで幅広く対応可能です。

用途

  • カテゴリでデータをフィルタリングする
  • アプリのビュー間を切り替える
  • フォーム入力セレクタの作成
  • テーマ切り替えの実装
  • ナビゲーションタブの構築
  • セグメントコントロールのカスタマイズ

主な機能

  • 高度にカスタマイズ可能な外観
  • スムーズなアニメーションの遷移
  • クロスプラットフォーム互換性
  • 動的コンテンツのサポート
  • 既存のウィジェットとの簡単な統合
  • レスポンシブデザインの処理

適している対象

  • モダンなUIを開発する開発者
  • セグメント選択を必要とするアプリ
  • 視覚的な仕上げを求めるデザイナー
  • 複数プラットフォームのプロジェクト
  • 再利用可能なコンポーネントを重視するチーム

注意事項

  • Flutter レイアウトの原則を理解している必要がある
  • 複雑なテーマには追加のスタイル設定が必要になる場合があります
  • 多数のタブによるパフォーマンスへの影響
  • 限定された組み込みアクセシビリティ機能
  • 非常に高い頻度の更新には最適化されていない

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Tab Toggle

pub package

A Beautiful and Simple Toggle Tab widget. It can be fully customized with desired icons, width, colors, text, corner radius, etc. It also maintains selection state.

Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  flutter_toggle_tab: "^latestVersion"

Import it:

import 'package:flutter_toggle_tab/flutter_toggle_tab.dart';

Usage Examples

Basic tab/toggle switch

image


// Here default theme colors are used for activeBgColor, activeFgColor, inactiveBgColor and inactiveFgColor
FlutterToggleTab
(
  width: 90, // width in percent
  borderRadius: 30,
  height: 50,
  selectedIndex: _tabTextIndexSelected,
  selectedBackgroundColors: [Colors.blue, Colors.blueAccent],
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w700),
  unSelectedTextStyle: TextStyle(
  color: Colors.black87,
  fontSize: 14,
  fontWeight: FontWeight.w500),
  dataTabs: _listTextTabToggle,
  selectedLabelIndex: (index) {
    setState(() {
        _tabTextIndexSelected = index;
    });
  },
  isScroll:false,
)

Basic tab/toggle switch with Custom Counter Widget

image


// Here default theme colors are used for activeBgColor, activeFgColor, inactiveBgColor and inactiveFgColor
FlutterToggleTab
(
  width: 90, // width in percent
  borderRadius: 30,
  height: 50,
  selectedIndex: _tabTextIndexSelected,
  selectedBackgroundColors: [Colors.blue, Colors.blueAccent],
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w700),
  unSelectedTextStyle: TextStyle(
  color: Colors.black87,
  fontSize: 14,
  fontWeight: FontWeight.w500),
  dataTabs: _listTextTabToggleCounter,
  selectedLabelIndex: (index) {
    setState(() {
        _tabTextIndexSelected = index;
    });
  },
  isScroll:false,
)

Basic tab/toggle switch with Icon

image

FlutterToggleTab
(
  width: 50,
  borderRadius: 15,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.blue,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listGenderText,
  selectedIndex: _tabTextIconIndexSelected,
  selectedLabelIndex: (index) {
    setState(() {
      _tabTextIconIndexSelected = index;
    });
  },
)

Basic tab/toggle switch with Icon Only and add margin on selected item

image

FlutterToggleTab
(
  width: 40,
  borderRadius: 15,
  selectedIndex: _tabIconIndexSelected,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.grey,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listIconTabToggle,
  selectedLabelIndex: (index) {
    setState(() {
      _tabIconIndexSelected = index;
    });
  },
  marginSelected: EdgeInsets.symmetric(horizontal: 4,vertical:4),
)

Update selected tab Programmatically
FlutterToggleTab
(
  width: 90,
  borderRadius: 15,
  selectedIndex: _tabSelectedIndexSelected,
  selectedTextStyle: TextStyle(
  color: Colors.white,
  fontSize: 18,
  fontWeight: FontWeight.w600),
  unSelectedTextStyle: TextStyle(
  color: Colors.grey,
  fontSize: 14,
  fontWeight: FontWeight.w400),
  dataTabs: _listTextSelectedToggle,
  selectedLabelIndex: (index) {
    setState(() {
      _tabSelectedIndexSelected = index;
    });
  },
)

Available Parameters

Param isRequired
List<DataTab> dataTabs Yes
Function(int) selectedLabelIndex Yes
TextStyle selectedTextStyle default:Theme.of(context).textTheme.bodyMedium, No
TextStyle unSelectedTextStyle default:Theme.of(context).textTheme.bodyMedium, No
int selectedIndex (listener for index selected) see on example Yes
double width (in Percent of width Screen) default: 100 No
double height (double) default: 45 No
double iconSize No
double borderRadius (double) default 30 No
List<Color> selectedBackgroundColors default : [ Theme.of(context).primaryColor] No
List<Color> unSelectedBackgroundColors default [ Color(0xffe0e0e0)] No
Alignment begin default : Alignment.topCenter No
Alignment end default : Alignment.bottomCenter No
bool isScroll default : true No
EdgeInsets marginSelected default : EdgeInsets.zero No
bool isShadowEnable default : true No
bool isInnerShadowEnable default : true No

LinkedIn

Buy me coffee if you love my works ☕️

buymeacoffe      ko-fi      paypal



カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。