JsonKey class

Field-level serialization customizations.

Constructors

JsonKey({String? name, bool ignore = false, dynamic defaultValue, String? converter, bool useEnumIndex = false, bool requiredKey = false, String? unknownEnumValue})
const

Properties

converter String?
Prefix for top-level converter functions: XToJson / XFromJson.
final
defaultValue → dynamic
Default value used when the input key is missing or null.
final
hashCode int
The hash code for this object.
no setterinherited
ignore bool
Excludes this field from generated serialization.
final
name String?
Override for the generated JSON key.
final
requiredKey bool
Requires the key to be present and non-null during deserialization.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unknownEnumValue String?
Enum value name used when an unknown enum input is received.
final
useEnumIndex bool
Encodes enums by index instead of enum name.
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