httpCall function

Future<Uint8List> httpCall(
  1. String url
)

Implementation

Future<Uint8List> httpCall(String url) async {
  http.Response response = await http
      .get(Uri.parse(url))
      .timeout(const Duration(milliseconds: 1000));
  if (response.statusCode == 200) {
    var body = response.body.trim();
    return base64Decode(body);
  }
  throw "Exception: ${response.statusCode}";
}