deserialize method Null safety
- Uint8List serialized
Deserializes the contents that was loaded from the blockchain.
Implementation
static ConsentModel deserialize(Uint8List serialized) {
List<Uint8List> unserialized = CompactSize.decode(serialized);
return ConsentModel(
unserialized[0],
TikiSdkDestination.deserialize(unserialized[1]),
about: String.fromCharCodes(unserialized[2]),
reward: String.fromCharCodes(unserialized[3]),
expiry: DateTime.fromMillisecondsSinceEpoch(
Bytes.decodeBigInt(unserialized[4]).toInt() * 1000),
);
}