prepareMessage method

  1. @override
Future<Uint8List?> prepareMessage(
  1. BuildContext? context
)
override

Will be called

Implementation

@override
Future<Uint8List?> prepareMessage(BuildContext? context) async {
  final http.Client client = _httpClient ?? http.Client();
  final http.Response response =
      await client.get(Uri.parse(url), headers: headers);
  if (_httpClient == null) {
    client.close();
  }
  return response.bodyBytes;
}