download method

  1. @override
Future<ParseWebFile> download({
  1. ProgressCallback? progressCallback,
})
override

Implementation

@override
Future<ParseWebFile> download({ProgressCallback? progressCallback}) async {
  if (url == null) {
    return this;
  }

  progressCallback ??= _progressCallback;

  _cancelToken = CancelToken();

  final ParseNetworkByteResponse response = await _client.getBytes(
    url!,
    onReceiveProgress: progressCallback,
    cancelToken: _cancelToken,
  );
  file = response.bytes as Uint8List?;

  return this;
}