-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
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 capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Use case
I want to request a controller for the SelectionArea
Widget.
Right now I find it almost impossible to select al items under a SelectionArea by default programmatically, the only way is after a user input the selectableRegionState
is created.
This is a current implementation
SelectionArea(
onSelectionChanged: (value) => print(value?.plainText),
contextMenuBuilder: (context, selectableRegionState) {
this.selectableRegionState = selectableRegionState; // <- This is when i initialize the state
return Text('....'); // your context menu
},
child: Stack(
alignment: Alignment.center,
children: ...state.result.map(TextQuad.new), // A widget with text's
),
),
Proposal
SelectionArea(
controller: controller, // <- new
onSelectionChanged: (value) => print(value?.plainText),
child: Stack(
alignment: Alignment.center,
children: ...state.result.map(TextQuad.new), // A widget with text's
),
),
And use it like:
controller.selectAll();
xlcodannd22
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 capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds