Skip to content

Added isExpanded field to ExpansionTile widget - #95727

Closed
happy-cat-coder wants to merge 5 commits into
flutter:masterfrom
happy-cat-coder:master
Closed

happy-cat-coder wants to merge 5 commits into
flutter:masterfrom
happy-cat-coder:master

Conversation

@happy-cat-coder

Copy link
Copy Markdown

This MR make the ExpansionTile widget able to expand and collapse programmatically by adding the public field isExpanded and listen for it's updates.

This MR is a fix for #60387 .

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard Bot added p: material_ui material_ui package in flutter/packages framework flutter/packages/flutter repository. See also f: labels. labels Dec 23, 2021
@goderbauer

Copy link
Copy Markdown
Member

The first part of what I said in #93849 (comment) is still true. The value of the flag and the actual internal state of the widget are getting out of sync, which will be confusing. This is not the kind of API we want in the framework. One way to provide a feature like this is to define an ExpandedController that you pass in and on the controller you can call open/close and also ask for the current status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants