-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
Description
Steps to reproduce
Run the following app, and scroll the list of integers by dragging up on the box.
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
title: 'Scaling drag destures is bad',
home: Scaffold(
body: Center(
child: SizedBox(
width: 240,
height: 240,
child: FittedBox(
fit: BoxFit.fill,
child: DecoratedBox(
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.all(Radius.circular(5)),
color: Colors.white,
),
child: Padding(
padding: EdgeInsets.all(1),
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(4)),
child: SizedBox(
width: 38,
height: 38,
child: Center(
child: ListWheelScrollView(
itemExtent: 15,
children: <Widget>[
...Iterable<int>.generate(100).map<Widget>((int index) {
return Text('$index');
}),
],
),
),
),
),
),
),
),
),
),
),
));
}Expected behavior
You expect the item being scrolled to follow your finger.
Actual behavior
The item being scrolled scrolls much faster than your finger moves, because the widget is being scaled 6x, and so the scrolling happens 6x as fast (because the drag gesture is also getting scaled 6x).
Metadata
Metadata
Assignees
Labels
frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.