Git Product home page Git Product logo

fluttercandies / extended_tabs Goto Github PK

View Code? Open in Web Editor NEW
264.0 5.0 47.0 2.32 MB

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.

Home Page: https://fluttercandies.github.io/extended_tabs/

License: MIT License

Objective-C 0.03% Dart 97.51% Kotlin 0.10% Swift 0.33% Ruby 1.11% HTML 0.91%
flutter tabs indicator synchronous

extended_tabs's Introduction

extended_tabs's People

Contributors

zmtzawqlp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

extended_tabs's Issues

[Bug report]

Version

4.1.0

Platforms

Android

Device Model

Android 11

flutter info

[!] Flutter (Channel stable, 3.10.5, on macOS 12.6.1 21G217 darwin-arm64, locale zh-Hans-CN)
    • Flutter version 3.10.5 on channel stable at /Users/bin_ren/.fvm/versions/3.10.5
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.19.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/bin_ren/.fvm/versions/3.10.5. Consider adding /Users/bin_ren/.fvm/versions/3.10.5/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (3 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1
    • Flutter download mirror https://storage.flutter-io.cn
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/bin_ren/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = /Users/bin_ren/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14B47b
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)

[✓] IntelliJ IDEA Community Edition (version 2022.3)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.79.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.66.0

[✓] Connected device (4 available)
    • MI 9 (mobile)   • bee39a63                  • android-arm64  • Android 11 (API 30)
    • iPhone (mobile) • 00008030-001474410A01802E • ios            • iOS 14.7.1 18G82
    • macOS (desktop) • macos                     • darwin-arm64   • macOS 12.6.1 21G217 darwin-arm64
    • Chrome (web)    • chrome                    • web-javascript • Google Chrome 114.0.5735.198

How to reproduce?

device-2023-07-05-175851.mp4

Logs

当多个tab同时包含多个tab,快速滑动时,会略过中间的字tab,直接滑动到第三个tab中,具体如图

Example code (optional)

No response

Contact

No response

ExtendedTabBarView嵌套ExtendedTabBarView联动滑动bug

在英语环境没问题,啊语环境有问题,看了一下源码,应该是_handleAncestorOrChild里面处理手势方向有问题,没有兼容啊语的手势方向
/// 这里的判断有问题
if ((delta < 0 && _position!.extentAfter == 0 && state!._position!.extentAfter != 0) || (delta > 0 && _position!.extentBefore == 0 && state!._position!.extentBefore != 0))

Error when cacheExtent set to null

By set cacheExtent to null, the error occurred when swiping between tab.

════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following NoSuchMethodError was thrown during performLayout():
The method '_greaterThanFromInteger' was called on null.
Receiver: null
Tried calling: _greaterThanFromInteger(2)

User-created ancestor of the error-causing widget was: 
  ExtendedTabBarView file:///Users/alex/Documents/OpenJMU/lib/pages/home/AppsPage.dart:203:20
When the exception was thrown, this was the stack: 
#0      Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1      int.> (dart:core-patch/integers.dart:101:18)
#2      RenderSliverFixedExtentBoxAdaptor._calculateTrailingGarbage (package:flutter/src/rendering/sliver_fixed_extent_list.dart:158:45)
#3      RenderSliverFixedExtentBoxAdaptor.performLayout (package:flutter/src/rendering/sliver_fixed_extent_list.dart:189:35)
#4      RenderObject.layout (package:flutter/src/rendering/object.dart:1701:7)

flutter 较新版本的PageMetrics中的devicePixelRatio属性变为了必要参数,希望可以更新一下依赖的sync_scroll_library库代码

Version

4.0.2

Platforms

Android, iOS

Device Model

iphone14 pro max

flutter info

Error (Xcode): ../../../../.pub-cache/hosted/pub.flutter-io.cn/sync_scroll_library-1.0.1/lib/src/gesture/gesture_state_mixin.dart:13:3: Error: No named parameter with the name 'devicePixelRatio'.

How to reproduce?

希望有空的话可以更新一下库,否则每次都要手动修改源码了

Logs

Error (Xcode): ../../../../.pub-cache/hosted/pub.flutter-io.cn/sync_scroll_library-1.0.1/lib/src/gesture/gesture_state_mixin.dart:13:3: Error: No named parameter with the name 'devicePixelRatio'.

Example code (optional)

No response

Contact

No response

如何动态改变 TabController length

Platforms

dart

Description

我在初始化函数里面初始化代码如下:

 tabController = TabController(
      initialIndex: idx,
      length:  arr.length, // 初始长度是4
      vsync: this,
    );

目前有这个一个需求,需要动态改变增加 TabController length的初始长度。请教一下应该如何实现。

目前尝试在逻辑中再次调用上面的代码,这次长度是8,出现报错了。

image

My code

No response

Try do it

No response

Calling null when set cacheExtent to null.

As cacheExtent provide null setter to make all pages cached, the code didn't handle null properly, as the code goes:

if (widget.cacheExtent > 0) {

null value will failed at here and the code will never goes to else.
But after added widget.cacheExtent != null, it will goes wrong with Infinity or NaN toInt with the value set to double.infinity, so it needs some further handle.

Active Tab

Hello,

I have 4 tabs in my module, i want to open a tab by default based on a user variable.
If user is admin i want to open firstly on the last tab,...

How can i do that?

Thank you

[Feature request] Horizontal swipe angle

Platforms

Android, iOS

Description

It is very common for a tab view to have a vertical scrollable component as a child - a similar issue exists for the flutter default TabBarView and is raised here flutter/flutter#110567 and flutter/flutter#11132. It seems unlikely that the referenced issues are to be fixed any time soon however is this something that can be incorporated into extended_tabs?

Why

Similar to Facebook/Instagram, the vertical scrolling should be prioritised above the horizontal scrolling. A slight incorrect angle of the digit when scrolling can accidentally change the tab, leading to poor user experience.

tab 文字设置背景色的时候 设置 foregroundIndicator: true, 这时候 指示器的颜色会盖住文字颜色

ExtendedTabBar( tabs: List.generate(_tabTitle.length, (int index) => Container( color: Colors.red, child: Tab(text: _tabTitle[index].title))), controller: _tabController, labelPadding: EdgeInsets.symmetric(horizontal: 12.w), indicatorSize: TabBarIndicatorSize.tab, labelColor: MyColor.color_FF000000, labelStyle: TextStyle(fontSize: 15.sp, color: MyColor.color_FF000000, fontWeight: FontWeight.w700), unselectedLabelColor: MyColor.color_FFFFFFFF, unselectedLabelStyle: TextStyle(fontSize: 15.sp, color: MyColor.color_FFFFFFFF), dragStartBehavior: DragStartBehavior.start, foregroundIndicator: true, indicatorWeight: 0, isScrollable: true, indicator: ColorTabIndicator(Colors.blue), )

tab 文字设置背景色的时候 设置 foregroundIndicator: true, 这时候 指示器的颜色会盖住文字颜色
如下图 选中的指示器是蓝色 未选中的背景色是红色
image

[Discussions]

Content

如果添加一个header在上方呢,类似sliver那样

请问子tab如何指定起始位置

你好。我这有两个tab0和tab1,他们下面分别有3个tab。当tab0下的tab滑到最后一个后,继续滑动,会到tab1下,但是tab1下的tabs是最后一个选中的。请问如何让tab1下的tab第一个选中呢?

extended_tabs

Platforms

dart

Description

目前是否选项卡文字渐变色,指示器可以自定义Indicator实现,但是选项卡文字是否支持,我尝试过一些方法都失败

Why

image
参考

[BUG] indicator 在特定情况下绘制错误

运行环境

Flutter: 2.5.0
extended_tabs: 2.3.0

问题描述

主要的问题是 indicator 并没有按照指定的 indicatorSize 参数生效,还有 mainAxisAlignment 在不为 null 的情况下 indicator 也会有问题,详细看下方的测试部分。

测试

demo code
import 'package:flutter/material.dart';

import 'package:extended_tabs/extended_tabs.dart';

class ExtendedTabPage extends StatefulWidget {
  const ExtendedTabPage({Key? key}) : super(key: key);

  @override
  State<ExtendedTabPage> createState() => _ExtendedTabPageState();
}

class _ExtendedTabPageState extends State<ExtendedTabPage> with SingleTickerProviderStateMixin {

  late TabController _tabController;

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: 3, vsync: this);
  }

  @override
  void dispose() {
    _tabController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    // 测试参数
    var textDirection = TextDirection.ltr;
    var isScrollable = false;
    var labelPadding = EdgeInsets.symmetric(horizontal: 16);
    var indicatorSize = TabBarIndicatorSize.label;
    var mainAxisAlignment = null;

    // 固定参数
    final indicator = BoxDecoration(
      borderRadius: BorderRadius.circular(26),
      color: Colors.blue,
    );
    final labelColor = Colors.black;
    final unselectedLabelColor = Colors.black54;
    final labelStyle = TextStyle(fontSize: 14, fontWeight: FontWeight.bold);
    final unselectedLabelStyle = TextStyle(fontSize: 14);

    return Scaffold(
      appBar: AppBar(
        title: const Text('Extended Tab Page'),
      ),
      body: Directionality(
        textDirection: textDirection,
        child: Column(
          children: [
            TabBar(
              controller: _tabController,
              isScrollable: isScrollable,
              labelPadding: labelPadding,
              indicatorSize: indicatorSize,
              indicator: indicator,
              labelColor: labelColor,
              unselectedLabelColor: unselectedLabelColor,
              labelStyle: labelStyle,
              unselectedLabelStyle: unselectedLabelStyle,
              tabs: const [
                Tab(text: 'F Tab 1'),
                Tab(text: 'F Tab 2'),
                Tab(text: 'F Tab 3'),
              ],
            ),
            Container(height: 16, color: Colors.black12,),
            ExtendedTabBar(
              controller: _tabController,
              isScrollable: isScrollable,
              labelPadding: labelPadding,
              indicatorSize: indicatorSize,
              indicator: indicator,
              labelColor: labelColor,
              unselectedLabelColor: unselectedLabelColor,
              labelStyle: labelStyle,
              unselectedLabelStyle: unselectedLabelStyle,
              mainAxisAlignment: mainAxisAlignment,
              tabs: const [
                Tab(text: 'E Tab 1'),
                Tab(text: 'E Tab 2'),
                Tab(text: 'E Tab 3'),
              ],
            ),

            Expanded(
              child: ExtendedTabBarView(
                controller: _tabController,
                children: [
                  for (var i = 1; i <= 3; i++)
                    buildPage(i, textDirection, isScrollable, labelPadding, indicatorSize, mainAxisAlignment),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget buildPage(
    int id,
    TextDirection textDirection,
    bool isScrollable,
    EdgeInsetsGeometry? labelPadding,
    TabBarIndicatorSize indicatorSize,
    MainAxisAlignment? mainAxisAlignment,
  ) {
    return Container(
      color: Colors.black12,
      alignment: Alignment.center,
      child: Text(
        'Page $id\n\n'
        'textDirection:               $textDirection\n'
        'labelPadding:               $labelPadding\n'
        'isScrollable:                 $isScrollable\n'
        'indicatorSize:              $indicatorSize\n'
        'mainAxisAlignment:   $mainAxisAlignment',
      ),
    );
  }
}
测试 上面的 `F Tab` 用的是flutter官方 `TabBar`, 下面的 `E Tab` 用的是 `ExtendedTabBar`

除了参数mainAxisAlignment 只有 ExtendedTabBar 中有,其他参数一致

用demo里的代码 两边tab效果一致
Screenshot_2022-05-26-18-10-59-935_com example flutter_test my_flutter_test

indicatorSize 改为 TabBarIndicatorSize.tab
E Tab 中的 indicator 并不是 tab 的尺寸而是 label 的尺寸
Screenshot_2022-05-26-18-11-15-575_com example flutter_test my_flutter_test

indicatorSize 改为 TabBarIndicatorSize.tab
mainAxisAlignment 改为 MainAxisAlignment.start
E Tab 中的 indicator 前2个tab尺寸正常,但是最后一个tab的右边界有问题
Screenshot_2022-05-26-18-13-14-544_com example flutter_test my_flutter_test
Screenshot_2022-05-26-18-13-16-102_com example flutter_test my_flutter_test

indicatorSize 改为 TabBarIndicatorSize.label
mainAxisAlignment 改为 MainAxisAlignment.start
E Tab 中的 indicator 并不是 label 的尺寸而是 tab 的尺寸,最后一个tab也一样有问题
Screenshot_2022-05-26-18-14-00-325_com example flutter_test my_flutter_test
Screenshot_2022-05-26-18-14-02-264_com example flutter_test my_flutter_test

indicatorSize 改为 TabBarIndicatorSize.label
mainAxisAlignment 改为 MainAxisAlignment.end
E Tab 中的 indicator 并不是 label 的尺寸而是 tab 的尺寸,但是最后一个tab正常
Screenshot_2022-05-26-18-14-22-481_com example flutter_test my_flutter_test

isScrollable 改为 true
indicatorSize 改为 TabBarIndicatorSize.tab
同测试3
Screenshot_2022-05-26-18-14-57-644_com example flutter_test my_flutter_test

isScrollable 改为 true
labelPadding 改为 EdgeInsets.symmetric(horizontal: 8)
indicatorSize 改为 TabBarIndicatorSize.tab
mainAxisAlignment 改为 MainAxisAlignment.center
和测试3的问题一样
Screenshot_2022-05-26-18-20-12-607_com example flutter_test my_flutter_test

isScrollable 改为 true
labelPadding 改为 EdgeInsets.symmetric(horizontal: 32)
indicatorSize 改为 TabBarIndicatorSize.tab
mainAxisAlignment 改为 MainAxisAlignment.center
同上
Screenshot_2022-05-26-18-21-03-748_com example flutter_test my_flutter_test
Screenshot_2022-05-26-18-20-59-105_com example flutter_test my_flutter_test

textDirection 改为 TextDirection.rtl
indicatorSize 改为 TabBarIndicatorSize.tab
mainAxisAlignment 改为 MainAxisAlignment.end
同测试3
Screenshot_2022-05-26-18-23-05-093_com example flutter_test my_flutter_test

垂直滚动暂时还没有时间测,不知道有没有问题。

其他

问题应该是出在 _IndicatorPainter 里的 indicatorRect方法,看起来是为了适配 mainAxisAlignment,看 mainAxisAlignment 的注释,应该只会影响 isScrollable = false 时的样式,但是在上述的一些情况下会造成负面效果。

tab切换,生命周期

当存在有tab0,tab1,tab2,tab3,四个tab时:
从tab0->tab3时,调用为:
tab3.initState
tab0.dispose
然后从tab3->tab1时,调用为:
tab2.initState
tab2.dispose
tab1.initState
tab3.dispose
这里有办法不然他调用到tab2的initState和dispose方法吗?

滑动tab滚动异常

你好!
问题点: 横向切换tab,切换完立即进行界面上滑操作,此时不能响应上滑手势事件,还是在响应横向切换tab事件。

复现步骤: 在切换tab的过程中,刚切换到下一个tab,此时迅速进行上滑界面操作。

Laggy swiping between tabs

I'm building a news app(wordpress as a backend) that has 15 tabs(categories) in ExtendedTabBarView and when I set cache_extent=15, swiping(sliding with finger) between tabs is very smooth but the scrolling is laggy(probably due to high memory usage because it has to preload and cache 15 tabs with 10 post per tab), BUT when I set cache_extent=2, app works fine but swiping between tabs is laggy at the end of animation(transition), while when I TAP on single tab transition between tabs is always smooth, both on cache_extent 2 and 15. What can be the issue with this, I'm not saying thats your plugin a problem, but I need help, I'm struggling with this whole week. :D :D

If you need code sample or anything, just ask I will respond immediately. Keep up the good work. (:

子Tab切换到父Tab存在白线问题

不更改link.dart

只修改ListWidget

添加一个背景色

切换Tab存在白线。应该是GlowingOverscrollIndicator的阴影。

感谢作者提供很好的库

BouncingScrollPhysics not working

I'm trying to apply BouncingScrollPhysics when moving through the tabs but ClampingScrollPhysics is applied instead.

flutter doctor -v
[√] Flutter (Channel stable, 1.22.5, on Microsoft Windows [versão 10.0.19041.746], locale pt-BR)
• Flutter version 1.22.5 at C:\src\flutter
• Framework revision 7891006299 (6 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
• Android SDK at C:\Users\HTCF\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.0-rc4
• ANDROID_HOME = C:\Users\HTCF\AppData\Local\Android\sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.

[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Community Edition (version 2019.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.2
• Flutter plugin version 45.1.2
• Dart plugin version 193.7547

[√] VS Code (version 1.52.1)
• VS Code at C:\Users\HTCF\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.18.1

[√] Connected device (1 available)
• Moto G Play (mobile) • 0026091935 • android-arm • Android 7.1.1 (API 25)

• No issues found!

Please add null-safety

This is a great package, it just needs to be updated to null-safety now we have Flutter 2.

[Discussions] ExtendedTabBarView 内 调用 Scrollable.ensureVisible 为什么会出现这种现象(看视频)

Content

请看视频,我的预期,点击数字item时调用 demo 中的scrollToIdx 方法后,实现将某内容滚动到可见区域。alignmentPolicy: ScrollPositionAlignmentPolicy.explicit 配置时,发现点击 item后整个界面会向左动一下,然后回到再原位。请问一下怎么解决 @zmtzawqlp

Screen-2023-06-29-180323.mp4

下面是一个能复现的demo:


import 'package:extended_tabs/extended_tabs.dart';
import 'package:flutter/material.dart';


class DemoView extends StatefulWidget {
  const DemoView({Key? key}) : super(key: key);

  @override
  State<DemoView> createState() => _DemoViewState();
}

class _DemoViewState extends State<DemoView> with TickerProviderStateMixin{

  late TabController _controller;

  final List<GlobalKey> keys = <GlobalKey>[];
  @override
  void initState() {
    super.initState();
    _controller = TabController(
      initialIndex: 0,
      length: 10,
      vsync: this,
    );
    for(var i = 0; i < 10; i++){
      keys.add(GlobalKey());
    }
  }


  scrollToIdx(index){
    Scrollable.ensureVisible(
      keys[index].currentContext!,
      duration: const Duration(milliseconds: 500),
      alignmentPolicy: ScrollPositionAlignmentPolicy.explicit
    );
  }

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text("dddd"),
      ),
      body: Column(
        children: [
          ExtendedTabBar(
            tabs: List.generate(
                _controller.length,
                    (int index) => Tab(
                  text: 'Tab$index',
                )).toList(),
            controller: _controller,
            labelPadding: EdgeInsets.symmetric(horizontal: 30),
            labelColor: Colors.blue,
            isScrollable: _controller.length > 5,
            indicatorSize: TabBarIndicatorSize.tab,
            mainAxisAlignment: MainAxisAlignment.start,
            indicator: const ExtendedUnderlineTabIndicator(
//size: 31,
                insets: EdgeInsets.symmetric(horizontal: 30),
                borderSide: BorderSide(
                  color: Colors.red,
                  width: 1,
                )),
          ),
          Expanded(
              child:ExtendedTabBarView(
                children: [
                  Container(
                    color: Colors.white,
                    child: Column(
                      children: [
                        Container(
                          width: 200,
                          height: 200,
                          color: Colors.grey,
                          child: SingleChildScrollView(
                            child: Column(
                              children: [
                                for(int i=0; i<10; i++)
                                  InkWell(
                                    onTap: (){
                                      scrollToIdx(i+1);
                                    },
                                    child: Container(
                                      key: keys[i],
                                      margin: EdgeInsets.all(10),
                                      color: Colors.white,
                                      width: 50,
                                      height: 50,
                                      child: Center(
                                        child: Text('${i}'),
                                      ),
                                    ),
                                  )
                              ],
                            ),
                          ),
                        )
                      ],
                    )
                  ),
                    Container(color: Colors.blue),
                    Container(color: Colors.yellow),
                    Container(color: Colors.orange),
                    Container(color: Colors.orange),
                    Container(color: Colors.orange),
                    Container(color: Colors.orange),
                    Container(color: Colors.orange),
                    Container(color: Colors.orange),
                    Container(color: Colors.purple)
                  ],
                controller: _controller,
          )
          )
        ],
      ),
    );
  }
}


不支持两个ExtendedTabBarView[Bug report]

Version

extended_tabs: ^4.1.0

Platforms

Android, iOS

Device Model

OnePlus12 Android14

flutter info

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.16.2, on Microsoft Windows [版本 10.0.19045.4046], locale zh-CN)
    • Flutter version 3.16.2 on channel stable at D:\flutterSDK3.7.1\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9e1c857886 (3 months ago), 2023-11-30 11:51:18 -0600
    • Engine revision cf7a9d0800
    • Dart version 3.2.2
    • DevTools version 2.28.3
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at C:\Users\86136\AppData\Local\Android\Sdk
    • Platform android-34, build-tools 33.0.1
    • ANDROID_HOME = C:\Users\86136\AppData\Local\Android\Sdk
    • ANDROID_SDK_ROOT = C:\Users\86136\AppData\Local\Android\Sdk
    • Java binary at: D:\software\AndroidIde\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[!] Android Studio (version 2022.2)
    • Android Studio at D:\software\AS
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[!] Android Studio (version 2022.3)
    • Android Studio at D:\software\AndroidStudio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    X Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[√] Android Studio (version 2023.2)
    • Android Studio at D:\software\AndroidIde
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] Connected device (4 available)
    • PJD110 (mobile)   • 192.168.3.162:44293 • android-arm64  • Android 14 (API 34)
    • Windows (desktop) • windows             • windows-x64    • Microsoft Windows [版本 10.0.19045.4046]
    • Chrome (web)      • chrome              • web-javascript • Google Chrome 122.0.6261.71
    • Edge (web)        • edge                • web-javascript • Microsoft Edge 122.0.2365.66

[√] Network resources
    • All expected network resources are available.

! Doctor found issues in 3 categories.

How to reproduce?

嵌套两个ExtendedTabBarView,第二个ExtendedTabBarView无法滑动回到第一个ExtendedTabBarView的页面

Logs

No response

Example code (optional)

Scaffold(
            appBar: AppBar(
              backgroundColor: MyColor.primary,
              title: Text(
                "My Account",
                style: TextStyle(
                  fontWeight: FontWeight.w500,
                  fontSize: 18.sp,
                ),
              ),
              bottom: PreferredSize(
                preferredSize: Size.fromHeight(35.h),
                child: Container(
                  color: const Color(0xFFF3F5F0),
                  child: _UserProfileTabBar(
                    controller: _tabController,
                  ),
                ),
              ),
            ),
            body: ExtendedPageView(
              controller: _pageController,
              shouldIgnorePointerWhenScrolling: false,
              onPageChanged: (index) {
                _tabController.animateTo(index);
              },
              children: [
                AccountInfo(),
                IndexShortcutsList(),
                DriverInfo(),
                // OrderRecord()
                Column(
                  children: [
                    TabBar(
                        controller: _tabOrderController,
                        tabs: [
                      Tab(
                        text: LocaleKeys.cdCarRental.tr(),
                      ),
                      Tab(
                        text: LocaleKeys.shortTermOrder.tr(),
                      ),
                      Tab(
                        text: LocaleKeys.longTermOrder.tr(),
                      ),
                    ]),
                    Expanded(child: ExtendedTabBarView(
                      controller: _tabOrderController,
                      shouldIgnorePointerWhenScrolling: false,

                      children: [
                        OrderRecord(),
                        OrderRecord(),
                        OrderRecord(),
                      ],
                    ))
                  ],
                )
              ],
            ),
          )

Contact

No response

三级Tab,有出现第一级不能滚动切换到情况

提供的Demo是三级Tab的,滚动切换是正常的,这是同一children仅有一个孩子有多个分页。
但是,当同一children的孩子同时有多个分页就会在最后位置卡住,滚动切换不到另一级页面。
不知道是不是真正存在这个问题?

如下是正常的:

1 TAB0
1.1 - TAB00
 1.1.1 - - TAB000
 1.1.2 - - TAB001
1.2 - TAB01
2 TAB1

如下是会卡住的:

1 TAB0
1.1 - TAB00
1.1.1 - - TAB000
1.1.2 - - TAB001
1.2 - TAB01
1.2.1 - - TAB010
1.2.2 - - TAB011
2 TAB1

ExtendedTabBar 在scrollDirection: Axis.vertical情况下indicator中 paint(Canvas canvas, Offset offset..) offset值异常

Version

extended_tabs: ^4.0.2

Platforms

Android

Device Model

galaxy tab A7 (Android 11)

flutter info

[!] Flutter (Channel unknown, 3.3.10, on Microsoft Windows [版本 10.0.19045.2965], locale zh-CN)
    ! Flutter version 3.3.10 on channel unknown at E:\flutter sdk\flutter
    ! Upstream repository unknown
    • Framework revision 135454af32 (6 months ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at C:\Users\Administrator\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = C:\Users\Administrator\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java      
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.5.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.5.33530.505
    • Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2022.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] Connected device (4 available)
    • VRD W10 (mobile)  • RCJ6R20721000566 • android-arm64  • Android 10 (API 29)
    • Windows (desktop) • windows          • windows-x64    • Microsoft Windows [版本 10.0.19045.2965]
    • Chrome (web)      • chrome           • web-javascript • Google Chrome 112.0.5615.121
    • Edge (web)        • edge             • web-javascript • Microsoft Edge 113.0.1774.57

[√] HTTP Host Availability
    • All required HTTP hosts are available

How to reproduce?

30a5c109948d15a1788f9b3197b8a292.mp4

4939ed8c35baf1a90a903c16804e5fc

Logs

No response

Example code (optional)

No response

Contact

No response

关于2.8.1的tab加了height属性这回事

  /// The height of the [Tab].
  ///
  /// If null, the height will be calculated based on the content of the [Tab].  When `icon` is not
  /// null along with `child` or `text`, the default height is 72.0 pixels. Without an `icon`, the
  /// height is 46.0 pixels.
  final double? height;

看到就可以close了(手动狗头)

tabbar 快速滑动问题

进行到二级tab切换一级tab,继续快速滑动,会直接越过第二个一级tab的二级tab,滑到一级tab的第三个tab
另外二级tab滑到一级tab时阻力较大,请问有什么好的解决方案吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.