read method
Is called when a value has to be decoded.
Implementation
@override
ServerTimestamp read(BinaryReader reader) {
switch (reader.readByte()) {
case _serverId:
return const ServerTimestamp.server();
case _valueId:
return ServerTimestamp.value(reader.read() as DateTime);
default:
throw StateError('Unexpected server timestamp subtype!');
}
}