Repository navigation
Description
Background
Historically, Flutter has supported density adjustments through component-specific properties such as isDense, and through VisualDensity, which can be configured globally using ThemeData.visualDensity.
The new Material 3 Expressive density guidelines describe a component-scaling system using density levels starting at 0, with each negative step reducing component height by 4dp through adjustments to padding or dimensions.
While this is conceptually similar to Flutter's existing VisualDensity system, it is unclear how M3E component scaling is intended to be supported.
The existing M3E implementations appear to explicitly opt out of inheriting application-level density:
- [material_ui] Add Material 3 Expressive IconButton packages#12832 — M3E
IconButton - [material_ui] Add Material 3 Expressive
ElevatedButtonpackages#13084 — M3EElevatedButton
Both use VisualDensity.standard in their generated defaults, and PR #13084 includes a test explicitly verifying that ThemeData.visualDensity is ignored.
Although developers can override density through component-specific styles, this requires configuring each component family independently.
Questions
- Is there an existing plan for supporting M3E component scaling consistently across components?
- Should M3E components respect an explicitly configured application-level density, such as
ThemeData.visualDensity, while retaining standard density as the default? - Should a new, theme-level component-scaling API be introduced for M3E?
Related issue
- M3 density should be consistent across platforms #190578 — Discusses changing Flutter's default density to standard across platforms, but does not address whether M3E components should inherit explicitly configured theme-level density.
Activity
mbcorona commentedon Nov 4, 2026
HI @ChristopherMuir , routing this report as a proposal to the design team.
QuncCccccc commentedon Nov 4, 2026
Thanks for raising this! Here's why the M3E components use
VisualDensity.standardtoday, and what we plan to do.Why M3E ignores
ThemeData.visualDensitytodayThemeData.visualDensitydefaults tocompacton desktop. If M3E components followed it, desktop apps would get denser buttons without asking for them. For example, an extra small button would shrink from 32dp to 24dp, and its tap target from 48dp to 40dp.For now, you can still set the density per component, for example with
IconButtonThemeData(style: ButtonStyle(visualDensity: VisualDensity.compact)). I know it's a bit tedious, but it keeps the default in line with the Material guidelines, which say density should be opt-in.About your questions:
ThemeData.variant, the same flag as thevariantin each M3E component theme, to turn on M3E for all components. When it's on,ThemeData.visualDensitywould default to standard on every platform, and M3E components would readThemeData.visualDensityinstead of hardcoding standard. Then developers can set the density globally withThemeData.visualDensity, instead of in each component theme. Apps that don't turn on M3E keep today's defaults.ThemeData.variantturns on M3E, you can setThemeData.visualDensityonce and every M3E component will follow it. If you don't set it, the default stays standard. Until then, components that turn on M3E one by one keep using standard, becauseThemeData.visualDensitystill defaults to compact on desktop, and we can't tell whether the app set it.VisualDensityalready uses 4dp steps, which match the M3 density scale (0, -1, -2, ...).What do you think?
ChristopherMuir commentedon Nov 17, 2026
Hi @QuncCccccc That pretty much answers my questions; and I agree the plan does fufill the guidelines.
Thanks!