TypeConverter<D, S> class Null safety

Maps a custom dart object of type D into a primitive type S understood by the sqlite backend.

Dart currently supports DateTime, double, int, Uint8List, bool and String for S.

Using a type converter does impact the way drift serializes data classes to JSON by default. To control that, use a JsonTypeConverter or a custom ValueSerializer.

Also see BuildGeneralColumn.map for details.

Implementers

Constructors

TypeConverter()
Empty constant constructor so that subclasses can have a constant constructor.
const

Properties

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

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. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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