urlToBase64 method
Implementation
Future<String> urlToBase64(String url) async {
final response = await http.get(Uri.parse(url));
if (response.statusCode == 200) {
print(response.bodyBytes);
Uint8List bytes = response.bodyBytes;
return base64Encode(bytes);
} else {
throw Exception('Failed to load image');
}
}