Skip to content

Add toggle method to ExpansibleController. #181319

@ksokolovskyi

Description

@ksokolovskyi

Use case

Use case

The ExpansibleController has only expand and collapse methods. If the user wants to change the expandable state, the following code has to be written:

if (controller.isExpanded) {
   controller.collapse();
} else {
   controller.expand();
}

Proposal

Add ExpansibleController.toggle method to allow the user to change the expansion state with only one call.

controller.toggle();

Metadata

Metadata

Assignees

Labels

c: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages team

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions