Skip to content

StretchingOverscrollIndicator: frozen overscroll animation #146277

Closed

Description

@gilnobrega

Steps to reproduce

This bug is not easy to reproduce but I observed it on different devices.
It only happens with a certain combination of screen size, text scale, and keyboard height.

How I reproduced it:

  1. Set up a Pixel 6 Pro emulator (Android 13.0) with default settings and GBoard keyboard
  2. Set keyboard height to "Extra-tall"
  3. Run the code sample below
  4. Tap on the 'Press me' button and wait
  5. Tap it again if needed

Expected results

Overscroll animation does not freeze and finishes animating.
Content is not stretched.
Red container looks like a square.

Actual results

Overscroll animation may freeze. When this happens:

  • Content looks stretched.
  • Red container does not look like a square.

Code sample

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        brightness: Brightness.light,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final _focusNode1 = FocusNode();
  final _focusNode2 = FocusNode();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Align(
        alignment: Alignment.bottomCenter,
        child: MediaQuery(
          data: MediaQuery.of(context).copyWith(textScaleFactor: 1.0),
          child: SingleChildScrollView(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.end,
              children: <Widget>[
                const SizedBox(height: 350),
                Container(
                  width: 50,
                  color: Colors.red,
                  height: 50,
                ),
                TextButton(
                  onPressed: _onPressed,
                  child: const Text('Press me'),
                ),
                _TestFormField(
                    focusNode: _focusNode1, type: TextInputType.emailAddress),
                _TestFormField(
                    focusNode: _focusNode2, type: TextInputType.phone),
                const SizedBox(
                  height: 51.5,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }

  Future<void> _onPressed() async {
    await Clipboard.setData(const ClipboardData(text: ''));
    _focusNode2.requestFocus();
    await Future.delayed(const Duration(milliseconds: 1000));
    _focusNode1.requestFocus();
    await Future.delayed(const Duration(milliseconds: 1000));
    _focusNode2.requestFocus();
    await Future.delayed(const Duration(milliseconds: 1000));
    _focusNode2.requestFocus();
  }
}

class _TestFormField extends StatelessWidget {
  const _TestFormField({this.type, this.focusNode});

  final TextInputType? type;
  final FocusNode? focusNode;
  @override
  Widget build(BuildContext context) {
    return TextFormField(
      focusNode: focusNode,
      initialValue: '123456789',
      keyboardType: type,
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Screenshot 2024-04-04 at 15 58 22
Screen.Recording.2024-04-04.at.16.07.43.mov

Logs

Logs

Flutter Doctor output

Doctor output
flutter doctor -v
[!] Flutter (Channel master, 3.22.0-4.0.pre.36, on macOS 14.4.1 23E224
    darwin-arm64, locale en-GB)
    • Flutter version 3.22.0-4.0.pre.36 on channel master at
      /Users/gilnobrega/fvm/versions/custom_local
    ! Warning: `dart` on your path resolves to
      /opt/homebrew/Cellar/dart/2.17.6/libexec/bin/dart, which is not inside
      your current Flutter SDK checkout at
      /Users/gilnobrega/fvm/versions/custom_local. Consider adding
      /Users/gilnobrega/fvm/versions/custom_local/bin to the front of your path.
    ! Upstream repository https://github.com/gilnobrega/flutter.git is not a
      standard remote.
      Set environment variable "FLUTTER_GIT_URL" to
      https://github.com/gilnobrega/flutter.git to dismiss this error.
    • Framework revision ac2ca9347c (6 hours ago), 2024-04-04 05:09:20 -0400
    • Engine revision 4303dc0d7a
    • Dart version 3.5.0 (build 3.5.0-18.0.dev)
    • DevTools version 2.34.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.0)
    • Android SDK at /Users/gilnobrega/Library/Android/sdk
    • Platform android-34, build-tools 33.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS (Xcode 14.0)
    • Xcode at /Applications/Xcode-beta.app/Contents/Developer
    • Build 14A5294e
    ! CocoaPods 1.12.1 out of date (1.13.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#updating-cocoapods
      for instructions.

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

[✓] Android Studio (version 2022.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
      17.0.6+0-17.0.6b802.4-9586694)

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

[✓] Connected device (4 available)            
    • sdk gphone64 arm64 (mobile)     • emulator-5554         • android-arm64  •
      Android 13 (API 33) (emulator)
    • macOS (desktop)                 • macos                 • darwin-arm64   •
      macOS 14.4.1 23E224 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin         •
      macOS 14.4.1 23E224 darwin-arm64
    • Chrome (web)                    • chrome                • web-javascript •
      Google Chrome 123.0.6312.106

[✓] Network resources
    • All expected network resources are available.

Activity

  1. changed the title [-]`StretchOverscrollIndicator`: frozen overscroll animation[/-] [+]`StretchingOverscrollIndicator`: frozen overscroll animation[/+] on Apr 4, 2024
  2. added
    in triagePresently being triaged by the triage team
    on Apr 5, 2024
  3. huycozy commented on Apr 5, 2024

    @huycozy
    Member

    Thanks for the report. Even though there is no option to set keyboard height on Gboard app on my device (it means I'm using the default settings), the issue also appears. It's reproduced on Flutter stable channel 3.19.5 as well.

    flutter doctor -v (stable and master)
    [✓] Flutter (Channel stable, 3.19.5, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.19.5 on channel stable at /Users/huynq/Documents/GitHub/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 300451adae (8 days ago), 2024-03-27 21:54:07 -0500
        • Engine revision e76c956498
        • Dart version 3.3.3
        • DevTools version 2.31.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15C500b
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.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
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.87.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.84.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 123.0.6312.106
    
    [✓] Network resources
        • All expected network resources are available.
    
    • No issues found!
    [!] Flutter (Channel master, 3.22.0-5.0.pre.27, on macOS 14.1 23B74 darwin-x64, locale en-VN)
        • Flutter version 3.22.0-5.0.pre.27 on channel master at /Users/huynq/Documents/GitHub/flutter_master
        ! Warning: `flutter` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        ! Warning: `dart` on your path resolves to /Users/huynq/Documents/GitHub/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /Users/huynq/Documents/GitHub/flutter_master. Consider adding /Users/huynq/Documents/GitHub/flutter_master/bin to the front of your path.
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 9c6fcdac6f (3 hours ago), 2024-04-05 02:19:12 +0200
        • Engine revision d44462a42d
        • Dart version 3.5.0 (build 3.5.0-18.0.dev)
        • DevTools version 2.34.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 34.0.0)
        • Android SDK at /Users/huynq/Library/Android/sdk
        • Platform android-34, build-tools 34.0.0
        • ANDROID_HOME = /Users/huynq/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 15.2)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Build 15C500b
        • CocoaPods version 1.15.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2023.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
        • android-studio-dir = /Applications/Android Studio.app/
        • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    
    [✓] VS Code (version 1.87.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.84.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 14.1 23B74 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 123.0.6312.106
    
    [✓] Network resources
        • All expected network resources are available.
    
    ! Doctor found issues in 1 category.
  4. added
    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 Apr 5, 2024
  5. added a commit that references this issue on Apr 23, 2024
    dd647b0
  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Apr 24, 2024
  7. github-actions commented on May 8, 2024

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

  8. locked as resolved and limited conversation to collaborators on May 8, 2024
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

    P2Important issues not at the top of the work listf: scrollingViewports, list views, slivers, etc.found in release: 3.19Found to occur in 3.19found in release: 3.22Found to occur in 3.22frameworkflutter/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 versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework teamwaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions