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

パッケージ詳細v5.0.0

extended_tabs

Tab/TabBar/TabView のための強力な公式拡張ライブラリで、現在のタブがスクロールオーバーしたときに親または子のタブをスクロールでき、スクロール方向とキャッシュ範囲を設定できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
1.3万
いいね数
175
Pub ポイント
140

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

flutter pub add extended_tabs

パッケージ概要

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

ExtendedTabs は、Flutter の Tab、TabBar、TabView ウィジェット向けの強力な公式拡張ライブラリです。オーバースクロール時に親または子タブへのスクロール伝播を可能にし、カスタマイズ可能なスクロール方向をサポートし、パフォーマンス向上のためのキャッシュ範囲の設定を可能にすることで、デフォルトのタブ動作を強化しています。複雑なタブナビゲーションシナリオ向けに設計されており、すべての主要プラットフォームでネストされたまたはスクロール可能なタブ構造において、よりスムーズなユーザー体験を提供します。

用途

  • ネストされたタブナビゲーション
  • スクロール可能なタブインターフェース
  • パフォーマンス最適化されたタブビュー
  • カスタムスクロール方向の処理
  • 動的タブコンテンツの読み込み

主な機能

  • 親タブと子タブ間のオーバースクロール伝播
  • スクロール方向の設定
  • 調整可能なキャッシュ拡張
  • 公式拡張機能で、強力なプラットフォームサポートを備えています
  • 既存のタブウィジェットとのシームレスな統合

適している対象

  • 複雑なタブベースのUIを構築している開発者
  • ネストされたまたはスクロール可能なタブレイアウトを必要とするアプリ
  • パフォーマンスとスムーズなスクロールを重視するチーム
  • 複数のプラットフォームをターゲットにするプロジェクト
  • 動的なタブコンテンツを持つFlutterアプリケーション

注意事項

  • Flutter のスクロールシステムの理解が必要です
  • シンプルなタブ実装における複雑さを増加させる可能性があります
  • 基本的なタブのニーズよりも、高度なユースケースに適している
  • 基本的な例以外のドキュメントは限られている
  • 手動でのスクロールコントローラー管理の必要性

元の README

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

extended_tabs

pub package GitHub stars GitHub forks GitHub license GitHub issues FlutterCandies QQ 群

Language: English | 中文简体

A powerful official extension library of Tab/TabBar/TabView, which support to scroll ancestor or child Tabs when current is overscroll, and set scroll direction and cache extent.

Web demo for ExtendedTabs

Usage

dependencies:
  flutter:
    sdk: flutter
  extended_tabs: any
CarouselIndicator

Show tab indicator as Carousel style

   CarouselIndicator(
     controller: _controller,
     selectedColor: Colors.white,
     unselectedColor: Colors.grey,
     strokeCap: StrokeCap.round,
     indicatorPadding: const EdgeInsets.all(5),
   ),
ColorTabIndicator

Show tab indicator with color fill

    TabBar(
      indicator: ColorTabIndicator(Colors.blue),
      labelColor: Colors.black,
      tabs: [
        Tab(text: "Tab0"),
        Tab(text: "Tab1"),
      ],
      controller: tabController,
    )
Link
  /// if link is true and current tabbarview over scroll,
  /// it will check and scroll ancestor or child tabbarView.
  /// default is true
  final bool link;
  
  ExtendedTabBarView(
    children: <Widget>[
      List("Tab000"),
      List("Tab001"),
      List("Tab002"),
      List("Tab003"),
    ],
    controller: tabController2,
    link: true,
  )
ScrollDirection
  /// The axis along which the tab bar and tab view scrolls.
  ///
  /// Defaults to [Axis.horizontal].
  final Axis scrollDirection;

  Row(
    children: <Widget>[
      ExtendedTabBar(
        indicator: const ColorTabIndicator(Colors.blue),
        labelColor: Colors.black,
        scrollDirection: Axis.vertical,
        tabs: const <ExtendedTab>[
          ExtendedTab(
            text: 'Tab0',
            scrollDirection: Axis.vertical,
          ),
          ExtendedTab(
            text: 'Tab1',
            scrollDirection: Axis.vertical,
          ),
        ],
        controller: tabController,
      ),
      Expanded(
        child: ExtendedTabBarView(
          children: <Widget>[
            const ListWidget(
              'Tab1',
              scrollDirection: Axis.horizontal,
            ),
            const ListWidget(
              'Tab1',
              scrollDirection: Axis.horizontal,
            ),
          ],
          controller: tabController,
          scrollDirection: Axis.vertical,
        ),
      )
    ],
      )
CacheExtent
  /// cache page count
  /// default is 0.
  /// if cacheExtent is 1, it has two pages in cache
  final int cacheExtent;
  
  ExtendedTabBarView(
    children: <Widget>[
      List("Tab000"),
      List("Tab001"),
      List("Tab002"),
      List("Tab003"),
    ],
    controller: tabController2,
    link: true,
    cacheExtent: 1,
  )  
ShouldIgnorePointerWhenScrolling
  /// Whether the contents of the widget should ignore [PointerEvent] inputs.
  ///
  /// Setting this value to true prevents the use from interacting with the
  /// contents of the widget with pointer events. The widget itself is still
  /// interactive.
  ///
  /// For example, if the scroll position is being driven by an animation, it
  /// might be appropriate to set this value to ignore pointer events to
  /// prevent the user from accidentally interacting with the contents of the
  /// widget as it animates. The user will still be able to touch the widget,
  /// potentially stopping the animation.
  ///
  ///
  /// if true, child can't accept event before [ExtendedPageView],[ExtendedScrollable] stop scroll.
  ///
  ///
  /// if false, child can accept event before [ExtendedPageView],[ExtendedScrollable] stop scroll.
  /// notice: we don't know there are any issues if we don't ignore [PointerEvent] inputs when it's scrolling.
  ///
  ///
  /// Two way to solve issue that child can't hittest before [PageView] stop scroll.
  /// 1. set [shouldIgnorePointerWhenScrolling] false
  /// 2. use LessSpringClampingScrollPhysics to make animation quickly
  ///
  /// default is true.
  final bool shouldIgnorePointerWhenScrolling;
  
  ExtendedTabBarView(
    children: <Widget>[
      List("Tab000"),
      List("Tab001"),
      List("Tab002"),
      List("Tab003"),
    ],
    controller: tabController2,
    shouldIgnorePointerWhenScrolling: false,
    cacheExtent: 1,
  )  

カテゴリー

依存関係

依存関係一覧 1 件

  • sync_scroll_library^1.1.0

ソースリポジトリ

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