Skip to content

Make DragGestureRecognizer abstract methods public #151446

@angelosilvestre

Description

@angelosilvestre

Use case

DragGestureRecognizer relies on abstract methods that VerticalDragGestureRecognizer, HorizontalDragGestureRecognizer and PanGestureRecognizer implement.

Such methods include _considerFling, _hasSufficientGlobalDistanceToAccept, among others.

Since these methods are private, developers can't extend DragGestureRecognizer to create their own recognizers. For example, a developer might want to modify the distance required to accept the gesture. Currently, developers need to copy the whole DragGestureRecognizer to modify that.

Proposal

Make the abstract methods public. Also, provide public getters to the private members that the subclasses access, like _finalPosition and _globalDistanceMoved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterf: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions