ExtendedTabs는 Flutter의 Tab, TabBar, TabView 위젯을 위한 강력한 공식 확장 라이브러리입니다. 오버스크롤 시 조상 또는 자식 탭으로 스크롤 전파를 가능하게 하여 기본 탭 동작을 향상시키며, 사용자 정의 가능한 스크롤 방향을 지원하고 성능 향상을 위해 캐시 범위를 설정할 수 있습니다. 복잡한 탭 탐색 시나리오를 위해 설계되어 모든 주요 플랫폼에서 중첩되거나 스크롤 가능한 탭 구조에서 더 부드러운 사용자 경험을 제공합니다.
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.
/// if link is true and current tabbarview over scroll,/// it will check and scroll ancestor or child tabbarView./// default is truefinalbool 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].finalAxis scrollDirection;
Row(
children: <Widget>[
ExtendedTabBar(
indicator: constColorTabIndicator(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>[
constListWidget(
'Tab1',
scrollDirection: Axis.horizontal,
),
constListWidget(
'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 cachefinalint 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.finalbool shouldIgnorePointerWhenScrolling;
ExtendedTabBarView(
children: <Widget>[
List("Tab000"),
List("Tab001"),
List("Tab002"),
List("Tab003"),
],
controller: tabController2,
shouldIgnorePointerWhenScrolling: false,
cacheExtent: 1,
)