import 'dart:io'; import 'package:flutter/foundation.dart'; class DownloadManager { static Future downloadImgWithUrl(String urlStr) async { var httpClient = HttpClient(); try { var reqiest = await httpClient.getUrl(Uri.parse(urlStr)); var response = await reqiest.close(); // var bytes = await consolidateHttpClientResponseBytes(response); var bytes = await consolidateHttpClientResponseBytes(response); print("the bytes:${bytes}"); } catch(error) { print("the error:${error}"); } } }