JsonTypeConverter<D, S> mixin Null safety

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


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


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.
mapToSql(D? value) → S?
Map a value from an object in Dart into something that will be understood by the database.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toJson(D? value) → S?
Map a value from the Data class to json.
toString() String
A string representation of this object.


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