Skip to content

Stretching overscroll keeps stretching when change overscroll direction #88741

Description

@nt4f04uNd

Steps to Reproduce

Run the code sample and drag the list up and down so the overscroll direction constantly changes

Expected results: list stretches in one direction, then in the opposite. I didn't actually check how it's in Android 12 since I didn't set up the distro yet, but I think this is how it would look like.

Actual results: list jumps when drag direction changes, and constantly keeps stretching

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData.dark().copyWith(
        androidOverscrollIndicator: AndroidOverscrollIndicator.stretch,
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: SafeArea(
          child: Center(
            child: MyWidget(),
          ),
        ),
      ),
    );
  }
}

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ListView.builder(
      itemBuilder: (context, index) => Container(
        height: 50,
        color: Colors.amber[(index % 9 + 1) * 100],
        child: const Center(child: Text('Entry A')),
      ),
      itemCount: 10,
      padding: const EdgeInsets.all(8),
    );
  }
}
flutter doctor -v
[√] Flutter (Channel master, 2.5.0-7.0.pre.83, on Microsoft Windows [Version 10.0.19041.1110], locale ru-RU)
    • Flutter version 2.5.0-7.0.pre.83 at C:\dev\src\flutter
    • Upstream repository [email protected]:nt4f04und/flutter.git
    • FLUTTER_GIT_URL = [email protected]:nt4f04und/flutter.git
    • Framework revision 06be7e5392 (4 hours ago), 2021-08-15 14:37:02 -0400
    • Engine revision 1af0a20793
    • Dart version 2.15.0 (build 2.15.0-15.0.dev)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\danya\AppData\Local\Android\sdk
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.7)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.7.30621.155
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 4.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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 1.8.0_242-release-1644-b01)

[√] IntelliJ IDEA Community Edition (version 2020.3)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3
    • 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

[√] VS Code (version 1.59.0)
    • VS Code at C:\Users\danya\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.25.0

[√] Connected device (4 available)
    • Redmi Note 5 (mobile)   • 40c9f14       • android-arm64  • Android 9 (API 28)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Windows (desktop)       • windows       • windows-x64    • Microsoft Windows [Version 10.0.19041.1110]
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 92.0.4515.131
    • Edge (web)              • edge          • web-javascript • Microsoft Edge 92.0.902.67

! Doctor found issues in 1 category.
Desktop.2021.08.23.-.23.35.33.257.mp4

Activity

  1. TahaTesser commented on Aug 24, 2021

    @TahaTesser
    Contributor

    Hi @nt4f04uNd
    Thanks for filing the issue, I can reproduce it

    Preview

    2021_08_24_15_20_19.mp4

    Only reproduced on master as this is a recent change

    flutter doctor -v
    [✓] Flutter (Channel master, 2.5.0-7.0.pre.213, on Microsoft Windows [Version 10.0.22000.160], locale en-US)
        • Flutter version 2.5.0-7.0.pre.213 at C:\Users\Taha\Code\flutter_master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 6dc18ef74e (7 hours ago), 2021-08-24 11:09:04 +0530
        • Engine revision 926ce0d855
        • Dart version 2.15.0 (build 2.15.0-43.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at C:\Users\Taha\Code\android-sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_SDK_ROOT = C:\Users\Taha\Code\android-sdk
        • Java binary at: C:\Users\Taha\Code\android-studio\jre\bin\java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.1)
        • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        • Visual Studio Community 2019 version 16.11.31613.86
        • Windows 10 SDK version 10.0.19041.0
    
    [✓] Android Studio (version 2020.3)
        • Android Studio at C:\Users\Taha\Code\android-studio
        • 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.10+0-b96-7249189)
    
    [✓] VS Code (version 1.59.1)
        • VS Code at C:\Users\Taha\AppData\Local\Programs\Microsoft VS Code
        • Flutter extension version 3.25.0
    
    [✓] Connected device (6 available)
        • SM M025F (mobile)       • R9ZR205XX0A   • android-arm     • Android 11 (API 30)
        • sdk gphone x86 (mobile) • emulator-5554 • android-x86     • Android 11 (API 30) (emulator)
        • Windows (desktop)       • windows       • windows-x64     • Microsoft Windows [Version 10.0.22000.160]
        • Windows (UWP) (desktop) • winuwp        • windows-uwp-x64 •
        • Chrome (web)            • chrome        • web-javascript  • Google Chrome 92.0.4515.159
        • Edge (web)              • edge          • web-javascript  • Microsoft Edge 92.0.902.78
    
    • No issues found!
  2. added
    a: fidelityMatching the OEM platforms better
    p: material_uimaterial_ui package in flutter/packages
    f: scrollingViewports, list views, slivers, etc.
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-androidAndroid applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Aug 24, 2021
  3. HansMuller commented on Aug 26, 2021

    @HansMuller
    Contributor
  4. self-assigned this
    on Aug 26, 2021
  5. Piinks commented on Aug 26, 2021

    @Piinks
    Contributor

    Oh wow, that is wild! Thanks for reporting. I've checked in a native app, and it looks like this definitely needs an adjustment.

    Screen.Recording.2021-08-26.at.5.53.41.PM.mov
  6. Piinks commented on Jan 5, 2022

    @Piinks
    Contributor

    I am removing my assignment as work is planned to refactor this widget. cc/ @blasten
    I think managing the stretch with separate controllers for each end of the scroll view (super similar to the glow indicator), would be the right way to resolve this, but the currently planned work may handle that in a totally different way.

  7. removed their assignment
    on Jan 5, 2022
  8. github-actions commented on Mar 3, 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.

  9. locked as resolved and limited conversation to collaborators on Mar 3, 2023
  10. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: fidelityMatching the OEM platforms betterf: scrollingViewports, list views, slivers, etc.found in release: 2.5Found to occur in 2.5frameworkflutter/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