ServerTimestampHiveAdapter class

A hive TypeAdapter for ServerTimestamps.

This is needed when working with ServerTimestamp as otherwise the local hive adapter will not be able to store the timestamps. To register it, simply add the adapter to the hive local storage before initializing the repositories:

// register adapter
ref.read(hiveLocalStorageProvider).hive
  .registerAdapter(const ServerTimestampHiveAdapter())

// continue with repository initialization
await ref.read(repositoryInitializerProvider().future);

Constructors

ServerTimestampHiveAdapter([int typeId = defaultTypeId])
Default 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
typeId int
Called for type registration
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(BinaryReader reader) ServerTimestamp
Is called when a value has to be decoded.
override
toString() String
A string representation of this object.
inherited
write(BinaryWriter writer, ServerTimestamp obj) → void
Is called when a value has to be encoded.
override

Operators

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

Constants

defaultTypeId → const int
The default type id for the ServerTimestampHiveAdapter