Skip to content

[material_ui] Keep ExpansionPanelList dividers when expanded with 0 materialGapSize (#183974) - #12820

Open
benji-farquhar wants to merge 1 commit into
flutter:mainfrom
benji-farquhar:retain-expansion-panel-dividers
Open

[material_ui] Keep ExpansionPanelList dividers when expanded with 0 materialGapSize (#183974)#12820
benji-farquhar wants to merge 1 commit into
flutter:mainfrom
benji-farquhar:retain-expansion-panel-dividers

Conversation

@benji-farquhar

@benji-farquhar benji-farquhar commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Fixes flutter/flutter#183974
Supersedes flutter/flutter#183975

Ports the change originally submitted in flutter/flutter#183975 to packages/material_ui.

cc @dkwingsmt @victorsanni who previously reviewed and approved the original PR in flutter/flutter#183975.

Description

When ExpansionPanelList.materialGapSize is set to 0, MaterialGap is no longer inserted between expanded panels. This allows MergeableMaterial to preserve the dividers between adjacent expanded panels, creating a clean flat list appearance (ideal for nested lists or panels within cards).

This is the end result of the PR (before it, the dividers between panels were absent):
CleanShot 2026-09-10 at 17 17 05@2x

  • Guarded MaterialGap insertion in ExpansionPanelList with materialGapSize > 0.
  • Documented zero-gap behavior in materialGapSize with a <callout-box>.
  • Added example sample (expansion_panel_list.2.dart) and widget tests.
  • Updated expansion_panel_test.dart to verify gap insertion and zero-gap divider retention.
  • Added pending changelog entry.

Pre-Review Checklist

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

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Sep 10, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies ExpansionPanelList to preserve dividers and avoid inserting a MaterialGap when materialGapSize is set to 0. It includes documentation updates, a new example, and corresponding tests. The review feedback identifies syntax errors in the new example file where the EdgeInsets prefix was omitted on several padding properties.

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

Labels

p: material_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Support using dividers for expanded panel seperators in ExpansionPanelList

1 participant