Skip to content

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

@chipweinberger

Description

@chipweinberger

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(),
    );
  }
}

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: fidelityMatching the OEM platforms betterf: cupertinoflutter/packages/flutter/cupertino repositoryf: 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 onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions