Skip to content

[Android] Lists with AndroidOverscrollIndicator.stretch can be over scrolled infinitely with multi-touch #99264

Closed

Description

@RitickSaha

Steps to Reproduce:

  1. Use the Over-scroll behaviours on any scrollable widget.
    scrollBehavior: MaterialScrollBehavior( androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,),
  2. Start scrolling normally, this works perfectly
  3. Now, over scroll the view, hold the finger and use another finger to over scroll.

Expectation :

You will be able to over scroll infinitely and you UI will get stretched without limits.

Expected results:
My assumption is the stretch over-scroll should not be triggered if the stretch is already implemented.

Actual results:

This is an example of live app google Pay having this issue

Orignal UI After multiple continued over-scroll action

Hopefully everyone can face this problem.. this can also be a behaviour of specific OEMs,
So adding my device for ref: Samsung s10+

Sample Code:

/* main.dart */
void main() async {
runApp(Test());  
}

class TextScreen extends StatelessWidget {
  const TextScreen({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: ListView.builder(
            itemBuilder: (context, index) => ListTile(
              title: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Text(
                    index.toString(),
                  ),
                  Container(
                    height: 30,
                    width: 30,
                    decoration: BoxDecoration(
                      border: Border.all(
                        color: Colors.black,
                        width: 2,
                      ),
                      borderRadius: BorderRadius.all(
                        Radius.circular(25),
                      ),
                    ),
                  )
                ],
              ),
            ),
          ),
        ),
      ),
      scrollBehavior: MaterialScrollBehavior(
        androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
      ),
    );
  }
}
Logs
[✓] Flutter (Channel stable, 2.10.2, on macOS 12.1 21C52 darwin-x64, locale en-IN)
  • Flutter version 2.10.2 at *****/development/flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision 097d3313d8 (9 days ago), 2022-02-18 19:33:08 -0600
  • Engine revision a83ed0e5e3
  • Dart version 2.16.1
  • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
  • Android SDK at *****Android/sdk
  • Platform android-31, build-tools 31.0.0
  • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
  • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
  • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
  • Xcode at /Applications/Xcode.app/Contents/Developer
  • CocoaPods version 1.11.2

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

[✓] Android Studio (version 2021.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
  • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

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

[✓] Connected device (2 available)
  • **** (mobile) • O**NHQ****L9L • android-arm64  • Android 12 (API 31)
  • Chrome (web)     • chrome           • web-javascript • Google Chrome 98.0.4758.109

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

Activity

  1. maheshj01 commented on Feb 28, 2022

    @maheshj01
    Member

    Hi @RitickSaha, Thanks for filing the issue. Please share a minimal and complete code sample along with the output of flutter doctor -v to investigate the issue further.

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 28, 2022
  3. RitickSaha commented on Feb 28, 2022

    @RitickSaha
    Author

    Hi, @maheshmnj, Thanks for reaching back, I have attached the needed thing to reproduce the issue.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 28, 2022
  5. maheshj01 commented on Mar 1, 2022

    @maheshj01
    Member

    Thanks for the code sample @RitickSaha, I am kind of not sure If I understood your 3rd reproducible step I tried to stretch the UI by holding a stretch with another finger and couldn't see any unusual behavior Could you please clarify your 3rd step.

    Screen.Recording.2022-03-01.at.11.25.59.AM.mov
    flutter doctor -v (mac)
    [✓] Flutter (Channel stable, 2.10.2, on macOS 12.1 21C52 darwin-arm, locale en-GB)
        • Flutter version 2.10.2 at /Users/mahesh/Documents/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 097d3313d8 (2 days ago), 2022-02-18 19:33:08 -0600
        • Engine revision a83ed0e5e3
        • Dart version 2.16.1
        • DevTools version 2.9.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.10.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • 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.8+10-b944.6916264)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.34.0
    
    [✓] Connected device (3 available)
        • Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64  • Android 11 (API 30)
        • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.1 21C52 darwin-arm
        • Chrome (web)           • chrome           • web-javascript • Google Chrome 98.0.4758.102
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 1, 2022
  7. RitickSaha commented on Mar 1, 2022

    @RitickSaha
    Author

    Hopefully this time i could explain this properly.. You don’t have to do much to reproduce. Just over-scroll the view once and hold that touch [don't lift the finger].. and then just over-scroll the scroll view with another finger.

    If you try the same thing with on system apps on android 12 they will stretch after some extent. same with iOS.

    Here is the video demonstration, with the touched..

    Record_2022-03-01-17-48-44.mov
  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 1, 2022
  9. maheshj01 commented on Mar 1, 2022

    @maheshj01
    Member

    Thanks for the update @RitickSaha, I can reproduce the issue, Basically, we could stretch the overscroll as long as we want presuming the pointer never left the screen.

    Keep an eye on the bottom of the list in the video to see the list being overstretched

    Screen.Recording.2022-03-01.at.6.32.33.PM.mov
    flutter doctor -v (mac)
    [✓] Flutter (Channel stable, 2.10.2, on macOS 12.1 21C52 darwin-arm, locale en-GB)
        • Flutter version 2.10.2 at /Users/mahesh/Documents/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 097d3313d8 (2 days ago), 2022-02-18 19:33:08 -0600
        • Engine revision a83ed0e5e3
        • Dart version 2.16.1
        • DevTools version 2.9.2
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.10.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • 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.8+10-b944.6916264)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.34.0
    
    [✓] Connected device (3 available)
        • Redmi K20 Pro (mobile) • 192.168.1.2:5555 • android-arm64  • Android 11 (API 30)
        • macOS (desktop)        • macos            • darwin-arm64   • macOS 12.1 21C52 darwin-arm
        • Chrome (web)           • chrome           • web-javascript • Google Chrome 98.0.4758.102
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    • No issues found!
    
    [✓] Flutter (Channel master, 2.11.0-0.0.pre.715, on macOS 12.1 21C52 darwin-arm, locale en-GB)
        • Flutter version 2.11.0-0.0.pre.715 at /Users/mahesh/Documents/flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 8b95cd6f35 (7 hours ago), 2022-02-28 16:31:12 -0800
        • Engine revision 615a60512c
        • Dart version 2.17.0 (build 2.17.0-150.0.dev)
        • DevTools version 2.11.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/mahesh/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_HOME = /Users/mahesh/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
        • All Android licenses accepted.
    
    [!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        ! CocoaPods 1.10.2 out of date (1.11.0 is recommended).
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on
            the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.2)
        • 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.8+10-b944.6916264)
    
    [✓] IntelliJ IDEA Community Edition (version 2021.2.1)
        • IntelliJ at /Applications/IntelliJ IDEA CE.app
        • Flutter plugin version 61.2.4
        • Dart plugin version 212.5080.8
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.34.0
    
    [✓] Connected device (4 available)
        • Redmi K20 Pro (mobile) • 192.168.1.2:5555                     • android-arm64  • Android 11 (API 30)
        • iPhone 13 Pro (mobile) • CBEF6BFA-D3DC-4680-8900-E01C62A4B04C • ios            •
          com.apple.CoreSimulator.SimRuntime.iOS-15-2 (simulator)
        • macOS (desktop)        • macos                                • darwin-arm64   • macOS 12.1 21C52 darwin-arm
        • Chrome (web)           • chrome                               • web-javascript • Google Chrome 98.0.4758.109
    
    [✓] HTTP Host Availability
        • All required HTTP hosts are available
    
    ! Doctor found issues in 1 category.
    

    I looked at material 3 docs I couldn't find much about the expected behavior, May be @Piinks might have more info on this, Labeling this issue for further investigation from the team.

    There's an ongoing discussion about this #82906

  10. added
    f: scrollingViewports, list views, slivers, etc.
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Mar 1, 2022
  11. 1 remaining item

  12. changed the title [-]Stretching over-scroll stretches without limits when used Multi-touch[/-] [+][Android] Lists with `AndroidOverscrollIndicator.stretch` can be over scrolled infinitely with multi-touch[/+] on Mar 1, 2022
  13. self-assigned this
    on Mar 1, 2022
  14. Piinks commented on Mar 1, 2022

    @Piinks
    Contributor

    This is probably caused by #11884
    The stretch is informed by scrolling notifications. It does not know how many input devices may be contributing to them, so as more pointers drag on the scroll view, the indicator only knows how far the scroll view has been overscrolled, not how it got there.
    IIRC there is not a hard-coded stretch limit in the native implementation, but I'll double-check to see that the Android version has not changed since then.

    I think I can put in an upper bound limit that restricts the effect to the largest distance one pointer can traverse over the length of the screen, so even if you add more pointers it will reach a reasonable stopping point.

    Looking into this now...

  15. Piinks commented on Mar 1, 2022

    @Piinks
    Contributor

    Also related to #38926

  16. b3nni97 commented on Mar 2, 2022

    @b3nni97

    The [BouncingScrollPhysics] is also affected by this bug. You can use multiple fingers to increase the overscroll more and more.

  17. added
    r: fixedIssue is closed as already fixed in a newer version
    on Mar 3, 2022
  18. github-actions commented on Mar 17, 2022

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

  19. locked as resolved and limited conversation to collaborators on Mar 17, 2022
  20. added
    P0Critical issues such as a build break or regression
    and removed on Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressioncustomer: money (g3)f: scrollingViewports, list views, slivers, etc.found in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesplatform-androidAndroid applications specificallyr: 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