Remove describeEnum
The `describeEnum` method has been removed from the Flutter framework. Since Dart 2.14, enums have a `name` getter that does the same thing.
Summary
#
The describeEnum method has been removed from the framework because it's redundant with the
name
getter on Enum which was introduced in Dart 2.14.
Context
#
Historically, Flutter used describeEnum to return a String description of an enum value.
This became redundant when the name getter of Enum was introduced in
Dart 2.14.
Migration guide
#
If your code previously used the describeEnum method to get the value name of an enum member,
migrate your code to use the name getter on the instance itself.
enum Theme { light, dark }
final theme = describeEnum(Theme.light);
Theme.light.name;
Timeline
#
Landed in version: TBD
In stable release: TBD
References
#API documentation:
Relevant PRs:
除非另有说明,本文档之所提及适用于 Flutter 3.47.2 版本。本页面最后更新时间:2026-08-18。查看文档源码 或者 为本页面内容提出建议。