Skip to content

Make 'Selectable' to support getBoxesForSelection (TextSelection) #137371

@Dall127

Description

@Dall127

Is there an existing issue for this?

Use case

I would like to be able to use SelectableArea to layout my fixed position text, however, I still need to gather the Rects from the text to run my custom highlighting code.

Proposal

I would appreciate it if 'Selectable' were to offer getBoxesForSelection (TextSelection). After a preliminary search of the source code, it would seem as though all of the different pieces of data is there, it would be a matter of tying it all the pieces together in order to cleanly return the Rects from a given TextSelection. I'd be willing to work on this as well, but I would need a little direction and recommendation on where to start. My current issue is I'm unsure in the SelectableRegion/Area exists the ability to look through all the children who are Selectable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Needs Update

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions