In accordance with Flutter's Deprecation Policy, deprecated APIs that reached end of life after the 3.19 stable release have been removed.
- Who is affected
- Any code still referencing the removed API will fail to compile after upgrading. Code that uses TextTheme, TextStyle, ThemeData and related APIs.
- Practical impact
- Compile errors until migrated; must be addressed before upgrading.
- What action should I take?
- Review the linked source, update affected code and run your test suite before upgrading.
Before and after (from the official guide)
dart+39−41
Before
| 1 | // TextTheme | |
| 2 | // Base constructor | |
| 3 | TextTheme( | |
| 4 | − | headline1: headline1Style, |
| 5 | − | headline2: headline2Style, |
| 6 | − | headline3: headline3Style, |
| 7 | − | headline4: headline4Style, |
| 8 | − | headline5: headline5Style, |
| 9 | − | headline6: headline6Style, |
| 10 | − | subtitle1: subtitle1Style, |
| 11 | − | subtitle2: subtitle2Style, |
| 12 | − | bodyText1: bodyText1Style, |
| 13 | − | bodyText2: bodyText2Style, |
| 14 | − | caption: captionStyle, |
| 15 | − | button: buttonStyle, |
| 16 | − | overline: overlineStyle, |
| 17 | ); | |
| 18 | ||
| 19 | − | // copyWith |
| 20 | TextTheme.copyWith( | |
| 21 | − | headline1: headline1Style, |
| 22 | − | headline2: headline2Style, |
| 23 | − | headline3: headline3Style, |
| 24 | − | headline4: headline4Style, |
| 25 | − | headline5: headline5Style, |
| 26 | − | headline6: headline6Style, |
| 27 | − | subtitle1: subtitle1Style, |
| 28 | − | subtitle2: subtitle2Style, |
| 29 | − | bodyText1: bodyText1Style, |
| 30 | − | bodyText2: bodyText2Style, |
| 31 | − | caption: captionStyle, |
| 32 | − | button: buttonStyle, |
| 33 | − | overline: overlineStyle, |
| 34 | ); | |
| 35 | ||
| 36 | − | // Getters |
| 37 | TextStyle style; | |
| 38 | − | style = textTheme.headline1, |
| 39 | − | style = textTheme.headline2, |
| 40 | − | style = textTheme.headline3, |
| 41 | − | style = textTheme.headline4, |
| 42 | − | style = textTheme.headline5, |
| 43 | − | style = textTheme.headline6, |
| 44 | − | style = textTheme.subtitle1, |
| 45 | − | style = textTheme.subtitle2, |
| 46 | − | style = textTheme.bodyText1, |
| 47 | − | style = textTheme.bodyText2, |
| 48 | − | style = textTheme.caption, |
| 49 | − | style = textTheme.button, |
| 50 | − | style = textTheme.overline, |
After
| 1 | // TextTheme | |
| 2 | // Base constructor | |
| 3 | TextTheme( | |
| 4 | + | displayLarge: headline1Style, |
| 5 | + | displayMedium: headline2Style, |
| 6 | + | displaySmall: headline3Style, |
| 7 | + | headlineMedium: headline4Style, |
| 8 | + | headlineSmall: headline5Style, |
| 9 | + | titleLarge: headline6Style, |
| 10 | + | titleMedium: subtitle1Style, |
| 11 | + | titleSmall: subtitle2Style, |
| 12 | + | bodyLarge: bodyText1Style, |
| 13 | + | bodyMedium: bodyText2Style, |
| 14 | + | bodySmall: captionStyle, |
| 15 | + | labelLarge: buttonStyle, |
| 16 | + | labelSmall: overlineStyle, |
| 17 | ); | |
| 18 | ||
| 19 | TextTheme.copyWith( | |
| 20 | + | displayLarge: headline1Style, |
| 21 | + | displayMedium: headline2Style, |
| 22 | + | displaySmall: headline3Style, |
| 23 | + | headlineMedium: headline4Style, |
| 24 | + | headlineSmall: headline5Style, |
| 25 | + | titleLarge: headline6Style, |
| 26 | + | titleMedium: subtitle1Style, |
| 27 | + | titleSmall: subtitle2Style, |
| 28 | + | bodyLarge: bodyText1Style, |
| 29 | + | bodyMedium: bodyText2Style, |
| 30 | + | bodySmall: captionStyle, |
| 31 | + | labelLarge: buttonStyle, |
| 32 | + | labelSmall: overlineStyle, |
| 33 | ); | |
| 34 | ||
| 35 | TextStyle style; | |
| 36 | + | style = textTheme.displayLarge; |
| 37 | + | style = textTheme.displayMedium; |
| 38 | + | style = textTheme.displaySmall; |
| 39 | + | style = textTheme.headlineMedium; |
| 40 | + | style = textTheme.headlineSmall; |
| 41 | + | style = textTheme.titleLarge; |
| 42 | + | style = textTheme.titleMedium; |
| 43 | + | style = textTheme.titleSmall; |
| 44 | + | style = textTheme.bodyLarge; |
| 45 | + | style = textTheme.bodyMedium; |
| 46 | + | style = textTheme.bodySmall; |
| 47 | + | style = textTheme.labelLarge; |
| 48 | + | style = textTheme.labelSmall; |
Raw before / after
// TextTheme // Base constructor TextTheme( headline1: headline1Style, headline2: headline2Style, headline3: headline3Style, headline4: headline4Style, headline5: headline5Style, headline6: headline6Style, subtitle1: subtitle1Style, subtitle2: subtitle2Style, bodyText1: bodyText1Style, bodyText2: bodyText2Style, caption: captionStyle, button: buttonStyle, overline: overlineStyle, ); // copyWith TextTheme.copyWith( headline1: headline1Style, headline2: headline2Style, headline3: headline3Style, headline4: headline4Style, headline5: headline5Style, headline6: headline6Style, subtitle1: subtitle1Style, subtitle2: subtitle2Style, bodyText1: bodyText1Style, bodyText2: bodyText2Style, caption: captionStyle, button: buttonStyle, overline: overlineStyle, ); // Getters TextStyle style; style = textTheme.headline1, style = textTheme.headline2, style = textTheme.headline3, style = textTheme.headline4, style = textTheme.headline5, style = textTheme.headline6, style = textTheme.subtitle1, style = textTheme.subtitle2, style = textTheme.bodyText1, style = textTheme.bodyText2, style = textTheme.caption, style = textTheme.button, style = textTheme.overline,
// TextTheme // Base constructor TextTheme( displayLarge: headline1Style, displayMedium: headline2Style, displaySmall: headline3Style, headlineMedium: headline4Style, headlineSmall: headline5Style, titleLarge: headline6Style, titleMedium: subtitle1Style, titleSmall: subtitle2Style, bodyLarge: bodyText1Style, bodyMedium: bodyText2Style, bodySmall: captionStyle, labelLarge: buttonStyle, labelSmall: overlineStyle, ); TextTheme.copyWith( displayLarge: headline1Style, displayMedium: headline2Style, displaySmall: headline3Style, headlineMedium: headline4Style, headlineSmall: headline5Style, titleLarge: headline6Style, titleMedium: subtitle1Style, titleSmall: subtitle2Style, bodyLarge: bodyText1Style, bodyMedium: bodyText2Style, bodySmall: captionStyle, labelLarge: buttonStyle, labelSmall: overlineStyle, ); TextStyle style; style = textTheme.displayLarge; style = textTheme.displayMedium; style = textTheme.displaySmall; style = textTheme.headlineMedium; style = textTheme.headlineSmall; style = textTheme.titleLarge; style = textTheme.titleMedium; style = textTheme.titleSmall; style = textTheme.bodyLarge; style = textTheme.bodyMedium; style = textTheme.bodySmall; style = textTheme.labelLarge; style = textTheme.labelSmall;
Migration assistantAI-generated · grounded in cited sources
AI explanations are not configured
Set
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.Official migration guide·Verified classification (90%)
Listed in the official breaking-changes index; title states removal.
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.
Validation warnings
api-symbols: {"reason":"no referenced symbol found in the current API index","unresolved":["TextTheme","TextStyle","ThemeData","Color","ThemeData.colorScheme","BottomAppBarTheme","ColorScheme","CupertinoContextMenu.previewBuilder","CupertinoContextMenu","CupertinoContextMenu.animationOpensAt","Scrollbar.showTrackOnHover","Scrollbar","ScrollbarThemeData.showTrackOnHover","ScrollbarThemeData.trackVisibility","ScrollbarThemeData","MaterialState","MaterialStateProperty","KeepAliveHandle.release","KeepAliveHandle","InteractiveViewer.alignPanAxis","InteractiveViewer","PanAxis","MediaQuery.boldTextOverride","MediaQuery","AnimatedList","AnimatedGrid","AnimatedListItemBuilder","AnimatedListRemovedItemBuilder","AnimatedItemBuilder","AnimatedRemovedItemBuilder","FlutterDriver.enableAccessibility","FlutterDriver","TimelineSummary.writeSummaryToFile","TimelineSummary","ToolbarOptions","TextSelectionController","SelectableRegionState"]}
- 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 explanationAI-generated · grounded in cited sources
AI explanations are not configured
Set
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.Was this useful?