SchemaDocumentExt extension Null safety

SchemaDocumentExt

SchemaDocumentExt is an extension on the SchemaDocument class which provides a useful suite of methods to manage user generated data.

on
  • SchemaDocument

Methods

get<T>(String name) → T?
Returns the provided T value from the SchemaDocument for the given name of the field, or null if the field does not exist.
pull({String? cid}) Future<SchemaDocument?>
Pulls the SchemaDocument from the current accounts application-specific data store using the provided cid. The account then decrypts the data and its values are returned as a SchemaDocument. A succesful transaction will return a SchemaDocument.
save(String label) Future<SchemaDocument?>
Saves the SchemaDocument to the current accounts application-specific data store. The account then encrypts the data and effectively becomes the only entity to be able to view the values. A succesful transaction will return a UploadDocumentResponse.
set<T>(String name, T value) bool
Sets the provided T value to the SchemaDocument for the given name of the field. Returns true if the field was found and set, false otherwise.