In accordance with Flutter's Deprecation Policy, deprecated APIs that reached end of life after the 2.10 stable release have been removed.
- Who is affected
- Any code still referencing the removed API will fail to compile after upgrading. Code that uses TextField, MaxLengthEnforcement.enforce, MaxLengthEnforcement.none 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+9−9
Before
| 1 | − | const TextField textField = TextField(maxLengthEnforced: true); |
| 2 | − | const TextField textField = TextField(maxLengthEnforced: false); |
| 3 | − | final lengthEnforced = textField.maxLengthEnforced; |
| 4 | ||
| 5 | − | const TextFormField textFormField = TextFormField(maxLengthEnforced: true); |
| 6 | − | const TextFormField textFormField = TextFormField(maxLengthEnforced: false); |
| 7 | − | final lengthEnforced = textFormField.maxLengthEnforced; |
| 8 | ||
| 9 | − | const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforced: true); |
| 10 | − | const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforced: false); |
| 11 | − | final lengthEnforced = cupertinoTextField.maxLengthEnforced; |
After
| 1 | + | const TextField textField = TextField(maxLengthEnforcement: MaxLengthEnforcement.enforce); |
| 2 | + | const TextField textField = TextField(maxLengthEnforcement: MaxLengthEnforcement.none); |
| 3 | + | final lengthEnforced = textField.maxLengthEnforcement; |
| 4 | ||
| 5 | + | const TextFormField textFormField = TextFormField(maxLengthEnforcement: MaxLengthEnforcement.enforce); |
| 6 | + | const TextFormField textFormField = TextFormField(maxLengthEnforcement: MaxLengthEnforcement.none); |
| 7 | + | final lengthEnforced = textFormField.maxLengthEnforcement; |
| 8 | ||
| 9 | + | const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.enforce); |
| 10 | + | const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.none); |
| 11 | + | final lengthEnforced = cupertinoTextField.maxLengthEnforcement; |
Raw before / after
const TextField textField = TextField(maxLengthEnforced: true); const TextField textField = TextField(maxLengthEnforced: false); final lengthEnforced = textField.maxLengthEnforced; const TextFormField textFormField = TextFormField(maxLengthEnforced: true); const TextFormField textFormField = TextFormField(maxLengthEnforced: false); final lengthEnforced = textFormField.maxLengthEnforced; const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforced: true); const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforced: false); final lengthEnforced = cupertinoTextField.maxLengthEnforced;
const TextField textField = TextField(maxLengthEnforcement: MaxLengthEnforcement.enforce); const TextField textField = TextField(maxLengthEnforcement: MaxLengthEnforcement.none); final lengthEnforced = textField.maxLengthEnforcement; const TextFormField textFormField = TextFormField(maxLengthEnforcement: MaxLengthEnforcement.enforce); const TextFormField textFormField = TextFormField(maxLengthEnforcement: MaxLengthEnforcement.none); final lengthEnforced = textFormField.maxLengthEnforcement; const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.enforce); const CupertinoTextField cupertinoTextField = CupertinoTextField(maxLengthEnforcement: MaxLengthEnforcement.none); final lengthEnforced = cupertinoTextField.maxLengthEnforcement;
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":["TextField","MaxLengthEnforcement.enforce","MaxLengthEnforcement.none","MaxLengthEnforcement.truncateAfterCompositionEnds","TextFormField","CupertinoTextField","VelocityTracker","PointerDeviceKind","VelocityTracker.kind","PointerDeviceKind.touch","DayPicker","MonthPicker","CalendarDatePicker","FlatButton","RaisedButton","OutlineButton","TextButton","ElevatedButton","OutlinedButton","ButtonTheme","TextButtonTheme","ElevatedButtonTheme","OutlinedButtonTheme","ButtonStyle","ButtonStyleButton","ElevatedButtonThemeData","OutlinedButtonThemeData","TextButtonThemeData","Scaffold","SnackBar","ScaffoldMessenger","MaterialApp","RectangularSliderTrackShape.disabledThumbGapWidth","RectangularSliderTrackShape","ThemeData","TextSelectionThemeData","RenderEditable.onSelectionChanged","TextSelectionDelegate.textEditingValue","TextSelectionDelegate.userUpdateTextEditingValue","TextInputFormatter"]}
- 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?