uploadToGCS method
Implementation
Future<PixelBinImage?> uploadToGCS(
String url, Map<String, String> fields, File file) async {
var uri = Uri.parse(url);
var request = http.Request('PUT', uri);
fields.forEach((key, value) {
request.headers[key] = value;
});
request.bodyBytes = await file.readAsBytes();
var response = await request.send();
if (response.statusCode != 200) {
throw Exception('Failed to upload to GCS');
}
return null;
}