Skip to content
Boring Doc
DeprecatedMedium impactOfficial migration guidesince 3.16.0landed 3.14.0-2.0.pre

Deprecate describeEnum and update EnumProperty to be type strict

Framework · Official source

The global method `describeEnum` has been deprecated. Previous uses of `describeEnum(Enum.something)` should use `Enum.something.name` instead.

Original behavior

Dart 2.17 introduced enhanced enums, which added `Enum` as a type. As a result, all enums got a `name` getter, which made `describeEnum` redundant. Before that, enum classes were often analyzed using an `EnumProperty`.

New behavior

Remove `describeEnum`.

Who is affected
Code that still calls the deprecated API; it keeps working until removal but produces analyzer warnings. Code that uses Enum.something.name, EnumProperty, Enum and related APIs.
Practical impact
Warnings now; removal in a future release. Plan the migration but no immediate break.
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)

dart+2−2
Before
1 enum MyEnum { paper, rock }
2  
3−print(describeEnum(MyEnum.paper)); // output: paper
4  
5 // TextInputType is not an Enum
6−properties.add(EnumProperty<TextInputType>( ... ));
After
1 enum MyEnum { paper, rock }
2  
3+print(MyEnum.paper.name); // output: paper
4  
5 // TextInputType is not an Enum
6+properties.add(DiagnosticsProperty<TextInputType>( ... ));
Raw before / after
enum MyEnum { paper, rock }

print(describeEnum(MyEnum.paper)); // output: paper

// TextInputType is not an Enum
properties.add(EnumProperty<TextInputType>( ... ));
enum MyEnum { paper, rock }

print(MyEnum.paper.name); // output: paper

// TextInputType is not an Enum
properties.add(DiagnosticsProperty<TextInputType>( ... ));
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)

If you previously used describeEnum(Enum.field) to access the string value from an enum, you can now call Enum.field.name.

If you previously used EnumProperty<NotAnEnum>, you can now use the generic DiagnosticsProperty<NotAnEnum>.

Code before migration:

enum MyEnum { paper, rock }

print(describeEnum(MyEnum.paper)); // output: paper

// TextInputType is not an Enum
properties.add(EnumProperty&#x3C;TextInputType>( ... ));

Code after migration:

enum MyEnum { paper, rock }

print(MyEnum.paper.name); // output: paper

// TextInputType is not an Enum
properties.add(DiagnosticsProperty&#x3C;TextInputType>( ... ));
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 deprecation.

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 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?