Skip to content

NeverScrollableScrollPhysics doesn't work for Scrollable inside DraggableScrollableSheet in 3.7.3 #121021

Closed

Description

@aqrc

Steps to Reproduce

For Android:

  1. Execute flutter run on the code sample
  2. Try to scroll the list.
  3. On 3.3.10 it will NOT scroll, on 3.7.3 it will scroll.

Expected results:
Expected it to not be movable by scrolling gestures as in previous version of Flutter.

Actual results:
It actually scrolls, which may break UI/UX in certain cases (when the app expects the sheet to be scrolled via controller).

For Web:

Seems like on web it works correctly.

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(App());
}

class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Stack(
          children: [
            DraggableScrollableSheet(
              maxChildSize: 1,
              builder: (context, scrollController) => SingleChildScrollView(
                physics: const NeverScrollableScrollPhysics(),
                controller: scrollController,
                child: Column(
                  children: List.generate(
                    200,
                        (index) => Text(index.toString()),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
Flutter Doctor
[✓] Flutter (Channel stable, 3.7.3, on macOS 12.4 21F79 darwin-x64, locale en-IL)
    • Flutter version 3.7.3 on channel stable at /Users/andrey/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9944297138 (9 days ago), 2023-02-08 15:46:04 -0800
    • Engine revision 248290d6d5
    • Dart version 2.19.2
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/andrey/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: /Users/andrey/Library/Java/JavaVirtualMachines/corretto-11.0.17/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Corretto-11.0.17.8.1 (build 11.0.17+8-LTS)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.11.3

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

[!] Android Studio (version 2022.1)
    • 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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.1)
    • IntelliJ at /Applications/IntelliJ IDEA.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

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 12.4 21F79 darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 109.0.5414.119

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

! Doctor found issues in 1 category.

Activity

  1. added
    in triagePresently being triaged by the triage team
    on Feb 20, 2023
  2. exaby73 commented on Feb 20, 2023

    @exaby73
    Member

    Triage report

    I can reproduce this issue with Master (3.8.0-14.0.pre.2) and Stable (3.7.3). I can also confirm that it doesn't scroll in 3.3.10

    Code Sample (Same as OP)
    import 'package:flutter/material.dart';
    
    void main() {
      runApp(const App());
    }
    
    class App extends StatelessWidget {
      const App({super.key});
    
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          home: Scaffold(
            body: Stack(
              children: [
                DraggableScrollableSheet(
                  maxChildSize: 1,
                  builder: (context, scrollController) => SingleChildScrollView(
                    physics: const NeverScrollableScrollPhysics(),
                    controller: scrollController,
                    child: Column(
                      children: List.generate(
                        200,
                        (index) => Text(index.toString()),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),
        );
      }
    }
    flutter doctor -v (Master)
    [!] Flutter (Channel master, 3.8.0-14.0.pre.2, on Ubuntu 22.04.2 LTS 5.15.0-60-generic, locale en_US.UTF-8)
        • Flutter version 3.8.0-14.0.pre.2 on channel master at /home/exabyt3/fvm/versions/master
        ! Warning: `dart` on your path resolves to /usr/lib/dart/bin/dart, which is not inside your current Flutter SDK checkout at /home/exabyt3/fvm/versions/master. Consider adding /home/exabyt3/fvm/versions/master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision cc9b198213 (50 minutes ago), 2023-02-20 00:49:25 -0500
        • Engine revision 780279109e
        • Dart version 3.0.0 (build 3.0.0-257.0.dev)
        • DevTools version 2.21.1
        • 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 /home/exabyt3/Android/Sdk
        ✗ cmdline-tools component is missing
          Run `path/to/sdkmanager --install "cmdline-tools;latest"`
          See https://developer.android.com/studio/command-line for more details.
        ✗ Android license status unknown.
          Run `flutter doctor --android-licenses` to accept the SDK licenses.
          See https://flutter.dev/docs/get-started/install/linux#android-setup for more details.
    
    [✓] Chrome - develop for the web
        • CHROME_EXECUTABLE = /usr/bin/brave-browser
    
    [✓] Linux toolchain - develop for Linux desktop
        • Ubuntu clang version 14.0.0-1ubuntu1
        • cmake version 3.22.1
        • ninja version 1.10.1
        • pkg-config version 0.29.2
    
    [✓] Android Studio (version 2022.1)
        • Android Studio at /home/exabyt3/programs/android-studio
        • Flutter plugin version 72.1.2
        • Dart plugin version 221.6096
        • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    
    [✓] VS Code (version 1.75.1)
        • VS Code at /usr/share/code
        • Flutter extension version 3.58.0
    
    [✓] Connected device (2 available)
        • Linux (desktop) • linux  • linux-x64      • Ubuntu 22.04.2 LTS 5.15.0-60-generic
        • Chrome (web)    • chrome • web-javascript • Brave Browser 110.1.48.164
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 2 categories.
    
  3. added
    c: regressionIt was better in the past than it is now
    frameworkflutter/packages/flutter repository. See also f: labels.
    f: scrollingViewports, list views, slivers, etc.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    and removed
    in triagePresently being triaged by the triage team
    on Feb 20, 2023
  4. added
    P2Important issues not at the top of the work list
    on Feb 21, 2023
  5. self-assigned this
    on Feb 22, 2023
  6. joouadih commented on Mar 14, 2023

    @joouadih

    I can reproduce this issue. Flutter 3.7.7 • channel stable

  7. aqrc commented on Mar 20, 2023

    @aqrc
    Author

    @xu-baolin could you please estimate when this will be fixed? I have an app with the complex UI behavior which relies on the fact that the DraggableScrollableSheet can't be scrolled with gestures, and I can't release it without that fix.

  8. added
    r: fixedIssue is closed as already fixed in a newer version
    on Apr 12, 2023
  9. github-actions commented on Apr 26, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: regressionIt was better in the past than it is nowf: scrollingViewports, list views, slivers, etc.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions