avatar property

  1. @override
dynamic get avatar
override

Gets the user's avatar image (URL/Base64).

Returns a TransportableFile containing the avatar's URL or Base64 data.

Implementation

@override
TransportableFile? get avatar {
  TransportableFile? img = _image;
  if (img == null) {
    var uri = getProperty('avatar');
    img = TransportableFile.parse(uri);
    _image = img;
  }
  return img;
}
  1. @override
set avatar (dynamic img)
override

Sets the user's avatar image (URL/Base64).

@param img - New avatar image (URL/Base64)

Implementation

@override
set avatar(TransportableFile? img) {
  if (img == null || img.isEmpty) {
    setProperty('avatar', null);
  } else {
    setProperty('avatar', img.serialize());
  }
  _image = img;
}