Removed Flutter's `FloatingActionButton` (FAB) dependency on `ThemeData` accent properties.
Original behavior
This was a small part of the Material Theme System Updates project.
New behavior
Previously, the `accentIconTheme` provided a default for the `FloatingActionButton`'s `foregroundColor` property:
- Who is affected
- Applications and packages relying on the previous behaviour or signature. Code that uses FloatingActionButton, ThemeData, Theme and related APIs.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Before and after (from the official guide)
| 1 | MaterialApp( | |
| 2 | theme: ThemeData( | |
| 3 | − | accentIconTheme: IconThemeData(color: Colors.red), |
| 4 | ), | |
| 5 | ) |
| 1 | MaterialApp( | |
| 2 | theme: ThemeData( | |
| 3 | + | floatingActionButtonTheme: FloatingActionButtonThemeData( |
| 4 | + | foregroundColor: Colors.red, |
| 5 | + | ), |
| 6 | ), | |
| 7 | ) |
Raw before / after
MaterialApp(
theme: ThemeData(
accentIconTheme: IconThemeData(color: Colors.red),
),
)MaterialApp(
theme: ThemeData(
floatingActionButtonTheme: FloatingActionButtonThemeData(
foregroundColor: Colors.red,
),
),
)Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
This change occurred in two steps:
- If the foreground of a
FloatingActionButtonis set to a non-default color, a warning is now printed. - The
accentIconThemedependency was removed. If you haven't already done so, migrate your apps per the pattern below.
To configure the FloatingActionButton's foregroundColor
for all FABs, you can configure the theme's
floatingActionButtonTheme instead of its accentIconTheme.
Code before migration:
MaterialApp(
theme: ThemeData(
accentIconTheme: IconThemeData(color: Colors.red),
),
)Code after migration:
MaterialApp(
theme: ThemeData(
floatingActionButtonTheme: FloatingActionButtonThemeData(
foregroundColor: Colors.red,
),
),
)AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.