setFromBytes method
Implementation
Future<void> setFromBytes({
required final String name,
required final String extension,
required final Uint8List? bytes,
final int? maxSize
}) async {
if (bytes == null) throw Exception("bytes cant be null");
await PlatformTools().write(
name : name,
extension : extension,
bytes : bytes,
maxSize : maxSize
).then((_f) {
_file = _f;
_bytes = _f.bytes;
_error = false;
_hasImage = true;
_extension = extension;
notifyListeners();
}).onError((error, stackTrace) => _reset(error: true));
}