JsonEnum class Null safety

Allows configuration of how enum elements are treated as JSON.

Annotations
  • @Target({TargetKind.enumType})

Constructors

JsonEnum({bool alwaysCreate = false, FieldRename fieldRename = FieldRename.none})
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. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

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