JsonTypeConverter<D, S> mixin
A mixin for TypeConverters that should also apply to drift's builtin JSON serialization of data classes.
By default, a TypeConverter only applies to the serialization from Dart
to SQL (and vice-versa).
When a BuildGeneralColumn.map column (or a MAPPED BY
constraint in
.drift
files) refers to a type converter that inherits from
JsonTypeConverter, it will also be used to conversion from and to json.
- Superclass Constraints
- TypeConverter<
D, S>
- TypeConverter<
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fromJson(
S? json) → D? - Map a value from json to something understood by the data class.
-
mapToDart(
S? fromDb) → D? -
Maps a column from the database back to Dart.
inherited
-
mapToSql(
D? value) → S? -
Map a value from an object in Dart into something that will be understood
by the database.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
D? value) → S? - Map a value from the Data class to json.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited