Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Scrolling does not match iOS; inadvertent scrolling when user lifts up finger #97761

Closed
chipweinberger opened this issue Feb 4, 2022 · 15 comments · Fixed by #137381, #138512, #138843 or #139166
Assignees
Labels
a: fidelity Matching the OEM platforms better f: cupertino flutter/packages/flutter/cupertino repository f: scrolling Viewports, list views, slivers, etc. found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@chipweinberger
Copy link
Contributor

chipweinberger commented Feb 4, 2022

Flutter 2.8.1
iOS 15.3
iPhone 12 Mini

Problem: Doing the exact same gesture on both Flutter and the iOS Settings App, its far easier to accidentally scroll when you lift your finger up. It's actually kind of hard not to hit this behavior.

Given how important scrolling is, this seems really important to fix for users. It also looks pretty bad to developers because this is the kind of issue that React Native, and Native just gets right by design.

I think what is happening: we are detecting a 'Fling' gesture when we should not be? If you move your finger slowly this behavior does not happen, because we never confuse it for a fling perhaps. Maybe the 'Fling' logic is too simplistic and needs to take the last ~200 milliseconds of events into greater account?

inadvertant.scrolling.small.mov
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {

  const MyApp({Key? key}): super(key: key);

  Widget buildScrollWidget() {
    List<Widget> wList = [];
    for (int i = 0; i < 20; i++){
      wList.add(Container(height: 200, color: Colors.white));
      wList.add(Container(height: 200, color: Colors.grey));
      wList.add(Container(height: 200, color: Colors.blue));
      wList.add(Container(height: 200, color: Colors.green));
      wList.add(Container(height: 200, color: Colors.pink));
      wList.add(Container(height: 200, color: Colors.purple));
      wList.add(Container(height: 200, color: Colors.orange));
    }
    return ListView(children: wList);
  }

  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      title: 'Scroll Test',
      theme: const CupertinoThemeData(primaryColor: Colors.white),
      home: buildScrollWidget(),
    );
  }
}

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Feb 4, 2022
@darshankawar
Copy link
Member

iOS 15.3
iPhone 12 Mini

@chipweinberger I although don't have said OS and device, but I verified this behavior using latest master and stable (2.10.0) on iPhone 6s (OS 14.4.1) but didn't notice the unusual scrolling:

RPReplay-Final1643964993.MP4
stable, master flutter doctor -v

[✓] Flutter (Channel stable, 2.10.0, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-GB)
    • Flutter version 2.10.0 at /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (2 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.4 19E2269
      darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 97.0.4692.99

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

! Doctor found issues in 1 category.


[✓] Flutter (Channel master, 2.10.0-1.0.pre.421, on Mac OS X 10.15.4 19E2269
    darwin-x64, locale en-GB)
    • Flutter version 2.10.0-1.0.pre.421 at
      /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 58407234f5 (29 minutes ago), 2022-02-04 06:40:13 +0200
    • Engine revision dfaad2a2c2
    • Dart version 2.17.0 (build 2.17.0-79.0.dev)
    • DevTools version 2.10.0

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.4 19E2269
      darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 97.0.4692.99

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

! Doctor found issues in 1 category.

Can you upgrade to latest versions and try again to see if behavior still persists or not ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 4, 2022
@chipweinberger
Copy link
Contributor Author

@darshankawar theres some technique to it. I find it happens more if your thumb is flatter against the screen when you lift up. If your thumb is too “pointy”, it’s harder to repro.

Are there any considerations when switching Flutter versions? I don’t want to screw up my dev environment.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 4, 2022
@chipweinberger
Copy link
Contributor Author

Oh I didn’t know 2.10 just came out! I’ll upgrade and report back.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 4, 2022
@chipweinberger
Copy link
Contributor Author

I can repro on 2.10.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 4, 2022
@darshankawar darshankawar changed the title [Flutter 2.8.1] Flutter Scrolling does not match iOS; inadvertent scrolling when user lifts up finger Flutter Scrolling does not match iOS; inadvertent scrolling when user lifts up finger Feb 7, 2022
@darshankawar
Copy link
Member

Ok, I tried this behavior again on iPhone 12 mini and on iPhone 12 Pro max simulators and could see the scroll happening when I lift the pointer up:

97661.mov

But I was unable to replicate this on a physical device (iPhone 6s) as mentioned earlier.

As I observed, the extra scrolling doesn't occur everytime I try to scroll but occurs sometimes.

I am keeping it open and labeling it for further insights from the team on this behavior.

stable, master flutter doctor -v

[✓] Flutter (Channel master, 2.11.0-0.0.pre.452, on Mac OS X 10.15.4 19E2269
    darwin-x64, locale en-GB)
    • Flutter version 2.11.0-0.0.pre.452 at
      /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba01ec8faa (27 hours ago), 2022-02-05 22:05:18 -0500
    • Engine revision 0712096899
    • Dart version 2.17.0 (build 2.17.0-85.0.dev)
    • DevTools version 2.10.0

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

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

[✓] Connected device (3 available)
    • Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 • ios
      • iOS 14.4.1 18D61
    • macOS (desktop)           • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Chrome (web)              • chrome                                   •
      web-javascript • Google Chrome 97.0.4692.99

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

! Doctor found issues in 1 category.

[✓] Flutter (Channel stable, 2.10.0, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-GB)
    • Flutter version 2.10.0 at /Users/dhs/documents/fluttersdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5f105a6ca7 (2 days ago), 2022-02-01 14:15:42 -0800
    • Engine revision 776efd2034
    • Dart version 2.16.0
    • DevTools version 2.9.2

[!] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    ! Flutter recommends a minimum Xcode version of 13.
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.11.2

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

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

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-x64     • Mac OS X 10.15.4 19E2269
      darwin-x64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 97.0.4692.99

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

! Doctor found issues in 1 category.

/cc @Piinks

@darshankawar darshankawar added f: cupertino flutter/packages/flutter/cupertino repository f: scrolling Viewports, list views, slivers, etc. found in release: 2.10 Found to occur in 2.10 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on and removed in triage Presently being triaged by the triage team labels Feb 7, 2022
@chipweinberger
Copy link
Contributor Author

It’s really fascinating that you can reproduce this in the simulator! I would have thought it was finicky touch events causing this.

@darshankawar darshankawar added the found in release: 2.11 Found to occur in 2.11 label Feb 7, 2022
@Piinks Piinks added a: fidelity Matching the OEM platforms better P2 Important issues not at the top of the work list labels Feb 23, 2023
@rafaelmaia8384
Copy link

Any update on this? I can reproduce this behavior using a real device on iOS 16.12 iPhone 12 Pro. This happens on safari too.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
@chipweinberger
Copy link
Contributor Author

chipweinberger commented Aug 10, 2023

I can still repro in 3.10

@chipweinberger
Copy link
Contributor Author

chipweinberger commented Aug 10, 2023

The bug is very simple to understand - velocity_tracker.dart only adds new samples when your finger is moving.

Therefore, if you move your finger quickly & (important) stop suddenly with no extra movement, the last 3 samples will all be > 0 dy, and you will get positive estimated velocity when you lift your finger up.

Logs from velocity_tracker.dart:

// start moving finger
flutter: addPosition dy:-445.0
flutter: addPosition dy:-447.0
flutter: addPosition dy:-452.0
flutter: addPosition dy:-454.0
flutter: addPosition dy:-458.0
flutter: addPosition dy:-459.0
flutter: addPosition dy:-462.0
flutter: addPosition dy:-463.0
flutter: addPosition dy:-464.0
flutter: addPosition dy:-465.0
flutter: addPosition dy:-466.0
flutter: addPosition dy:-467.0
flutter: addPosition dy:-468.0
flutter: addPosition dy:-469.0
flutter: addPosition dy:-470.0
// stop moving finger here, keep it still, & lift it up any amount of time later
flutter: _previousVelocityAt(-2) samples(-467.0, -468.0)) dy:-176.772140710624
flutter: _previousVelocityAt(-1) samples(-468.0, -469.0)) dy:-375.0937734433609
flutter: _previousVelocityAt(0) samples(-469.0, -470.0)) dy:-175.71604287471447
flutter: primaryVelocity DragEndDetails(Velocity(0.0, -305.5)).primaryVelocity
flutter: createBallisticSimulation pixels 464.16666666666663 velocity 305.4699824197211

There are 2 options to fix it:

  1. sample uniformly per unit time (a larger more annoying change)
  2. consider elapsed time since the last sample (easy), i.e. if we are sampling at 60fps & and 160ms has elapsed since the last sample, we should infer there are 10 more samples of 0 movement but they were just not recorded.

@chipweinberger
Copy link
Contributor Author

This is a simple fix that completely solves the problem.

velocity_tracker.dart

class VelocityTracker {

+  final Stopwatch sinceLastSample = Stopwatch();

  void addPosition(Duration time, Offset position) {
+    sinceLastSample.start();
  }
  
  VelocityEstimate? getVelocityEstimate() {
+    // there has been no user movement
+    if (sinceLastSample.elapsedMilliseconds > 60) {
+      return const VelocityEstimate(
+        pixelsPerSecond: Offset.zero,
+        confidence: 1.0,
+        duration: Duration.zero,
+        offset: Offset.zero,
+      );
}

class IOSScrollViewFlingVelocityTracker extends VelocityTracker {

  @override
  void addPosition(Duration time, Offset position) {
+    sinceLastSample.start();


  VelocityEstimate? getVelocityEstimate() {
+    // there has been no user movement
+    if (sinceLastSample.elapsedMilliseconds > 60) {
+      return const VelocityEstimate(
+        pixelsPerSecond: Offset.zero,
+        confidence: 1.0,
+        duration: Duration.zero,
+        offset: Offset.zero,
+      );

  class MacOSScrollViewFlingVelocityTracker extends IOSScrollViewFlingVelocityTracker {

  VelocityEstimate? getVelocityEstimate() {
+    // there has been no user movement
+    if (sinceLastSample.elapsedMilliseconds > 60) {
+      return const VelocityEstimate(
+        pixelsPerSecond: Offset.zero,
+        confidence: 1.0,
+        duration: Duration.zero,
+        offset: Offset.zero,
+      );

auto-submit bot pushed a commit that referenced this issue Sep 25, 2023
… iOS; inadvertent scrolling when user lifts up finger (#132291)

## Issue

**Issue:** #97761

https://github.com/flutter/flutter/assets/1863934/53c5e0df-b85a-483c-a17d-bddd18db3aa9

## The Cause:

The bug is very simple to understand - `velocity_tracker.dart` **only adds new samples while your finger is moving**.

**Therefore**, if you move your finger quickly & (important) stop suddenly with no extra movement, the last 3 samples will all be > 0 dy. Regardless of how long you wait, you will get movement when you lift up your finger.

**Logs from velocity_tracker.dart:**
Notice: all 3 `_previousVelocityAt` are `dy > 0` despite a 2 second delay since the last scroll
```
// start moving finger
flutter: addPosition dy:-464.0
flutter: addPosition dy:-465.0
flutter: addPosition dy:-466.0
flutter: addPosition dy:-467.0
flutter: addPosition dy:-468.0
flutter: addPosition dy:-469.0
flutter: addPosition dy:-470.0
// stop moving finger here, keep it still for 2 seconds & lift it up
flutter: _previousVelocityAt(-2) samples(-467.0, -468.0)) dy:-176.772140710624
flutter: _previousVelocityAt(-1) samples(-468.0, -469.0)) dy:-375.0937734433609
flutter: _previousVelocityAt(0) samples(-469.0, -470.0)) dy:-175.71604287471447
flutter: primaryVelocity DragEndDetails(Velocity(0.0, -305.5)).primaryVelocity
flutter: createBallisticSimulation pixels 464.16666666666663 velocity 305.4699824197211
```

## The Fix

**There are 3 options to fix it:**
A. sample uniformly *per unit time* (a larger more risky change, hurts battery life)
B. consider elapsed time since the last sample. If greater than X, assume no more velocity. (easy & just as valid)
C. similar to B, but instead add "ghost samples" of velocity zero, and run calculations as normal (a bit tricker, of dubious benefit imo)

**For Option B I considered two approaches:**
1. _get the current timestamp and compare to event timestamp._  This is tricky because events are documented to use an arbitrary timescale & I wasn't able to find the code that generates the timestamps. This approach could be considered more.
2. _get a new timestamp using Stopwatch and compare now vs when the last sample was added._ This is the solution implemented here.  There is a limitation in that we don't know when addSamples is called relative to the event. But, this estimation is already on a very low latency path & still it gives us a *minimum* time bound which is sufficient for comparison. 

**This PR chooses the simplest of the all solutions. Please try it our yourself, it completely solves the problem �** Option _B.1_ would be a nice alternative as well, if we can define and access the same timesource as the pointer tracker in a maintainable simple way.

## After Fix

https://github.com/flutter/flutter/assets/1863934/be50d8e7-d5da-495a-a4af-c71bc541cbe3
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Sep 28, 2023
Mairramer pushed a commit to Mairramer/flutter that referenced this issue Oct 10, 2023
… iOS; inadvertent scrolling when user lifts up finger (flutter#132291)

## Issue

**Issue:** flutter#97761

https://github.com/flutter/flutter/assets/1863934/53c5e0df-b85a-483c-a17d-bddd18db3aa9

## The Cause:

The bug is very simple to understand - `velocity_tracker.dart` **only adds new samples while your finger is moving**.

**Therefore**, if you move your finger quickly & (important) stop suddenly with no extra movement, the last 3 samples will all be > 0 dy. Regardless of how long you wait, you will get movement when you lift up your finger.

**Logs from velocity_tracker.dart:**
Notice: all 3 `_previousVelocityAt` are `dy > 0` despite a 2 second delay since the last scroll
```
// start moving finger
flutter: addPosition dy:-464.0
flutter: addPosition dy:-465.0
flutter: addPosition dy:-466.0
flutter: addPosition dy:-467.0
flutter: addPosition dy:-468.0
flutter: addPosition dy:-469.0
flutter: addPosition dy:-470.0
// stop moving finger here, keep it still for 2 seconds & lift it up
flutter: _previousVelocityAt(-2) samples(-467.0, -468.0)) dy:-176.772140710624
flutter: _previousVelocityAt(-1) samples(-468.0, -469.0)) dy:-375.0937734433609
flutter: _previousVelocityAt(0) samples(-469.0, -470.0)) dy:-175.71604287471447
flutter: primaryVelocity DragEndDetails(Velocity(0.0, -305.5)).primaryVelocity
flutter: createBallisticSimulation pixels 464.16666666666663 velocity 305.4699824197211
```

## The Fix

**There are 3 options to fix it:**
A. sample uniformly *per unit time* (a larger more risky change, hurts battery life)
B. consider elapsed time since the last sample. If greater than X, assume no more velocity. (easy & just as valid)
C. similar to B, but instead add "ghost samples" of velocity zero, and run calculations as normal (a bit tricker, of dubious benefit imo)

**For Option B I considered two approaches:**
1. _get the current timestamp and compare to event timestamp._  This is tricky because events are documented to use an arbitrary timescale & I wasn't able to find the code that generates the timestamps. This approach could be considered more.
2. _get a new timestamp using Stopwatch and compare now vs when the last sample was added._ This is the solution implemented here.  There is a limitation in that we don't know when addSamples is called relative to the event. But, this estimation is already on a very low latency path & still it gives us a *minimum* time bound which is sufficient for comparison. 

**This PR chooses the simplest of the all solutions. Please try it our yourself, it completely solves the problem �** Option _B.1_ would be a nice alternative as well, if we can define and access the same timesource as the pointer tracker in a maintainable simple way.

## After Fix

https://github.com/flutter/flutter/assets/1863934/be50d8e7-d5da-495a-a4af-c71bc541cbe3
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 12, 2023
@Piinks Piinks reopened this Oct 19, 2023
@Piinks
Copy link
Contributor

Piinks commented Oct 19, 2023

The change that resolved this issue is being reverted because it introduced a bunch of flakes in the framework. See #135728

@darshankawar darshankawar removed the r: fixed Issue is closed as already fixed in a newer version label Oct 20, 2023
@flutter-triage-bot flutter-triage-bot bot unlocked this conversation Oct 20, 2023
auto-submit bot pushed a commit that referenced this issue Nov 15, 2023
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #132291
Fixes #97761

The change was reverted due to flakiness it introduced in tests that use fling gestures.
* #135728
@Piinks Piinks self-assigned this Nov 15, 2023
auto-submit bot added a commit that referenced this issue Nov 15, 2023
Reverts #137381
Initiated by: Piinks
This change reverts the following previous change:
Original Description:
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #132291
Fixes #97761

The change was reverted due to flakiness it introduced in tests that use fling gestures.
* #135728
auto-submit bot pushed a commit that referenced this issue Nov 21, 2023
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #137381 which attempted to reland #132291
Fixes #97761

The original change was reverted due to flakiness it introduced in tests that use fling gestures.
* #135728

It was reverted again due to a change in the leak tracking tests that broke it.
@darshankawar darshankawar added the r: fixed Issue is closed as already fixed in a newer version label Nov 27, 2023
auto-submit bot pushed a commit that referenced this issue Nov 29, 2023
This updates the implementation to use the stopwatch from the Clock object and pipes it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands #138843 attempted to reland #137381 which attempted to reland #132291
Fixes #97761

1. The original change was reverted due to flakiness it introduced in tests that use fling gestures.
  * Using a mocked clock through the test binding fixes this now
2. It was reverted a second time because a change at tip of tree broke it, exposing memory leaks, but it was not rebased before landing. 
  * These leaks are now fixed
3. It was reverted a third time, because we were so excellently quick to revert those other times, that we did not notice the broken benchmark that only runs in postsubmit.
  * The benchmark is now fixed
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2023
caseycrogers pushed a commit to caseycrogers/flutter that referenced this issue Dec 29, 2023
This updates the implementation to use the stopwatch from the Clock object and piping it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands flutter#137381 which attempted to reland flutter#132291
Fixes flutter#97761

The original change was reverted due to flakiness it introduced in tests that use fling gestures.
* flutter#135728

It was reverted again due to a change in the leak tracking tests that broke it.
caseycrogers pushed a commit to caseycrogers/flutter that referenced this issue Dec 29, 2023
This updates the implementation to use the stopwatch from the Clock object and pipes it through to the TestWidgetsFlutterBinding so it will be kept in sync with FakeAsync.

Relands flutter#138843 attempted to reland flutter#137381 which attempted to reland flutter#132291
Fixes flutter#97761

1. The original change was reverted due to flakiness it introduced in tests that use fling gestures.
  * Using a mocked clock through the test binding fixes this now
2. It was reverted a second time because a change at tip of tree broke it, exposing memory leaks, but it was not rebased before landing. 
  * These leaks are now fixed
3. It was reverted a third time, because we were so excellently quick to revert those other times, that we did not notice the broken benchmark that only runs in postsubmit.
  * The benchmark is now fixed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better f: cupertino flutter/packages/flutter/cupertino repository f: scrolling Viewports, list views, slivers, etc. found in release: 2.10 Found to occur in 2.10 found in release: 2.11 Found to occur in 2.11 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list r: fixed Issue is closed as already fixed in a newer version team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
5 participants