deserialize method Null safety

OwnershipModel deserialize(
  1. Uint8List serialized
)

Deserializes the contents that was loaded from the blockchain.

Implementation

static OwnershipModel deserialize(Uint8List serialized) {
  List<Uint8List> unserialized = CompactSize.decode(serialized);
  return OwnershipModel(
      source: String.fromCharCodes(unserialized[0]),
      type: TikiSdkDataTypeEnum.fromValue(
          String.fromCharCodes(unserialized[1])),
      origin: String.fromCharCodes(unserialized[2]),
      about: String.fromCharCodes(unserialized[3]),
      contains: jsonDecode(String.fromCharCodes(unserialized[4]))
          .map<String>((e) => e.toString())
          .toList());
}