Repository navigation
[Android] Lists with AndroidOverscrollIndicator.stretch can be over scrolled infinitely with multi-touch #99264
Copy link
Copy link
Closed
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressioncustomer: money (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
Steps to Reproduce:
- Use the Over-scroll behaviours on any scrollable widget.
scrollBehavior: MaterialScrollBehavior( androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,), - Start scrolling normally, this works perfectly
- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressioncustomer: money (g3)f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.found in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesplatform-androidAndroid applications specificallyAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version


Activity
maheshj01 commentedon Feb 28, 2022
Hi @RitickSaha, Thanks for filing the issue. Please share a minimal and complete code sample along with the output of
flutter doctor -vto investigate the issue further.RitickSaha commentedon Feb 28, 2022
Hi, @maheshmnj, Thanks for reaching back, I have attached the needed thing to reproduce the issue.
maheshj01 commentedon Mar 1, 2022
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)
RitickSaha commentedon Mar 1, 2022
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
maheshj01 commentedon Mar 1, 2022
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)
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
1 remaining item
[-]Stretching over-scroll stretches without limits when used Multi-touch[/-][+][Android] Lists with `AndroidOverscrollIndicator.stretch` can be over scrolled infinitely with multi-touch[/+]Piinks commentedon Mar 1, 2022
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...
Piinks commentedon Mar 1, 2022
Also related to #38926
b3nni97 commentedon Mar 2, 2022
The [BouncingScrollPhysics] is also affected by this bug. You can use multiple fingers to increase the overscroll more and more.
github-actions commentedon Mar 17, 2022
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 -vand a minimal reproduction of the issue.