getFile method

Future<Uint8List> getFile(
  1. String url, {
  2. void onReceiveProgress(
    1. int x,
    2. int? x1
    )?,
})

Implementation

Future<Uint8List> getFile(String url,
    {void Function(int x, int? x1)? onReceiveProgress}) async {
  var res = await request<Uint8List>(url,
      options: Options(
        responseType: ResponseType.bytes,
      ),
      onReceiveProgress: onReceiveProgress);
  var list = res.data;
  if (list != null) return list;
  return Uint8List.fromList([]);
}