flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
164.97k stars 27.18k forks source link

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

Closed aqrc closed 1 year ago

aqrc commented 1 year ago

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 ```dart 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. ```
exaby73 commented 1 year ago

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) ```dart 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. ```
joouadih commented 1 year ago

I can reproduce this issue. Flutter 3.7.7 • channel stable

aqrc commented 1 year ago

@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.

github-actions[bot] commented 1 year ago

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.