TypeConverter<D, S> class abstract

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.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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 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