downloadBytes method

Future<Uint8List> downloadBytes(
  1. String url
)

Downloads content as bytes from a URL.

Implementation

Future<Uint8List> downloadBytes(String url) async {
  try {
    final response = await dio.get(
      url,
      options: Options(responseType: ResponseType.bytes),
    );
    return response.data;
  } catch (e) {
    rethrow;
  }
}