fluttercandies / extended_tabs

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.
https://fluttercandies.github.io/extended_tabs/
MIT License
268 stars 49 forks source link

不支持两个ExtendedTabBarView[Bug report] #37

Closed InTheClodus closed 7 months ago

InTheClodus commented 7 months ago

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

zmtzawqlp commented 7 months ago

哪里嵌套了2个?

InTheClodus commented 7 months ago
ExtendedTabBarView

噢,不好意思,复制错了,我这里的ExtendedTabBarView,应该是用ExtendedPageView来做的,刚才调为ExtendedTabBarView试试,然后就给复制上来了,实际上这个应该用的是ExtendedPageView😂

zmtzawqlp commented 7 months ago

ExtendedPageView 没有说过可以直接用呀,你可以自己处理下。https://juejin.cn/post/7131909401446727711。 利用 https://pub-web.flutter-io.cn/packages/sync_scroll_library 这个库。 关键是你为啥不直接用 ExtendedTabBarView ,跟 ExtendedPageView 想过一样的呢?

InTheClodus commented 7 months ago

ExtendedPageView 没有说过可以直接用呀,你可以自己处理下

好吧,我看看怎么做,谢谢哈