패키지, 저장소 및 앱 카테고리 검색

패키지 상세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의 스크롤 시스템에 대한 이해가 필요합니다
  • 간단한 탭 구현에서 복잡성을 증가시킬 수 있습니다
  • 기본 탭 요구 사항보다는 고급 사용 사례에 적합
  • 기본 예제를 넘어서는 문서가 제한적
  • 수동 스크롤 컨트롤러 관리의 잠재적 필요성

원본 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

소스 저장소

이 패키지를 사용하는 프로젝트