-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
I faced a problem when using TabBarView that includes multiple ScrollViews.
I try to scroll vertically, but sometimes fail. It is because the thumb moves diagonally when operating with one hand.
I want to prioritize vertical (ie inner) scroll than horizontal. Because in mobile apps, vertical scrolling is more frequently operation than horizontal.
TabBarView uses HorizontalDragGestureRecognizer internally. It judges whether the delta of horizontal movement is sufficient.
bool get _hasSufficientPendingDragDeltaToAccept => _pendingDragOffset.dx.abs() > kTouchSlop; |
The delta is same value in both VerticalDragGestureRecognizer and HorizontalDragGestureRecognizer. I think that changing that value will work for TabBarView/PageView.
In addition, I found kPagingTouchSlop
.
const double kPagingTouchSlop = kTouchSlop * 2.0; // Logical pixels |
/// The distance a touch has to travel for us to be confident that the gesture
/// is a paging gesture. (Currently not used, because paging uses a regular drag
/// gesture, which uses kTouchSlop.)
// TODO(ianh): Create variants of HorizontalDragGestureRecognizer et al for
// paging, which use this constant.
const double kPagingTouchSlop = kTouchSlop * 2.0; // Logical pixels
Flutter Doctor
[✓] Flutter (on Mac OS X 10.12.5 16F73, locale ja-JP, channel master)
• Flutter at /Applications/flutter
• Framework revision 4891506931 (2 days ago), 2017-07-07 16:00:45 -0700
• Engine revision 8ad1576f27
• Tools Dart version 1.25.0-dev.4.0
pauldemarco, osama-lionheart, seijik42, lifenautjoe, ludwiktrammer and 7 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitycustomer: crowdAffects or could affect many people, though not necessarily a specific customer.Affects or could affect many people, though not necessarily a specific customer.f: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team