JsonEnum class

Allows configuration of how enum elements are treated as JSON.

Annotations
  • @Target.new({TargetKind.enumType})

Constructors

JsonEnum({bool alwaysCreate = false, FieldRename fieldRename = FieldRename.none, String? valueField})
const

Properties

alwaysCreate → bool
If true, _$[enum name]EnumMap is generated for in library containing the enum, even if the enum is not used as a field in a class annotated with JsonSerializable.
final
fieldRename → FieldRename
Defines the naming strategy when converting enum entry names to JSON values.
final
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
valueField → String?
Specifies the field within an "enhanced enum" to use as the value to use for serialization.
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