EnumValue class

Annotation to assist in generating code for enum values.


Name

The name of the enum value, should be formatted as a human readable name

Extension Method: readable

default: The name will be converted to Capital Case

(e.g. isNotAvailable => Is Not Available)


Description

The description of the enum value

Extension Method: description

default: The description will be generated from the doc comment or null if EnumAssist.useDocCommentAsDescription is set to false
(either annotation or build.yaml file)


Serialized Value

The serialized represenation of the enum value.

Can be manipulated via EnumAssist.serializedFormat
(either annotation or build.yaml file)

Extension Method: serialized
Classes Where Referenced: ExampleConv & _ExampleNullableConv

default: Non-formatted name of the enum value


Int Value

The enum value converted to an integer
Incremented by 1 based on the previous enum value

(e.g. one => 0, two => 200, three => 201, four => 202)

Extension Method: toInt

default: 0 indexed & incremented by 1


Use Doc Comment As Description

Whether to use the doc comment of the enum for the description method.

EnumValue.description will override the doc comment description.

If false, the description will return null unless overridden by EnumValue.description.

default: true


Extensions

Methods to be generated for the enum

Defined classes must extend MapExtension or MaybeExtension

default: []

Constructors

EnumValue({String? readable, String? description, int? intValue, Object? serializedValue, bool? useDocCommentAsDescription, List<Extension<Object?>>? extensions})
Annotation to assist in generating code for enum values.
const

Properties

description String?
The description of the enum value
final
extensions List<Extension<Object?>>?
Methods to be generated for the enum
final
hashCode int
The hash code for this object.
no setterinherited
intValue int?
The enum value converted to an integer
Incremented by 1 based on the previous enum value
final
readable String?
The name of the enum value, should be formatted as a human readable name
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serializedValue Object?
The serialized represenation of the enum value.
final
useDocCommentAsDescription bool?
Whether to use the doc comment of the enum for the description method.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited