EnumName
LogoDart

EnumName#

extension EnumName on Enum

Annotations: @Since.new("2.15")

Access to the name of an enum value.

This method is declared as an extension method instead of an instance method in order to allow enum values to have the name name.

Properties#

name extension no setter#

String get name

The name of the enum value.

The name is a string containing the source identifier used to declare the enum value.

For example, given a declaration like:

enum MyEnum {
  value1,
  value2
}

the result of MyEnum.value1.name is the string "value1".

Available on Enum, provided by the EnumName extension

Implementation
String get name => _name;