Skip to content

Conversation

@DaveShuckerow
Copy link
Contributor

Part 1 of solving #16763.

This adds a new field to the Draggable API: axis. Behavior covered in the DartDoc, but setting it limits the underlying _DragAvatar's motion to the assigned axis. When axis is null, the behavior is the same as before. As a result, this won't break anything.

/// than in a scroll because the draggable widget, being the more specific
/// widget, will out-compete the [Scrollable] for vertical gestures.
///
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove one extra blank line here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

return velocity;
}
return new Velocity(
pixelsPerSecond: _restrictAxis(velocity.pixelsPerSecond));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put this all on one line or put a comma after the first ) so that the next one ends up on the next line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Offset _restrictAxis(Offset offset) {
if (axis == null) {
return offset;
} else if (axis == Axis.horizontal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can omit the else if you have a return in the previous block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@Hixie
Copy link
Contributor

Hixie commented May 15, 2018

LGTM modulo nits

@DaveShuckerow DaveShuckerow merged commit 5159ab3 into flutter:master May 15, 2018
HansMuller pushed a commit that referenced this pull request May 15, 2018
HansMuller pushed a commit that referenced this pull request May 15, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants