getURLData function

Future<Uint8List> getURLData(
  1. String url, {
  2. String? user,
  3. String? password,
  4. bool withCredentials = true,
})

Makes a HTTP request and returns url content as Uint8List.

Implementation

Future<Uint8List> getURLData(String url,
    {String? user, String? password, bool withCredentials = true}) {
  var client = http.BrowserClient()..withCredentials = withCredentials;
  return client.readBytes(Uri.parse(url));
}