getDownloadUrl method

Future<String?> getDownloadUrl({
  1. required String url,
})

Implementation

Future<String?> getDownloadUrl({
  required String url,
}) async {
  try {
    final response = await get(Uri.parse(url));
    final parsed = jsonDecode(response.body);
    return parsed['data']['downloadUrl'];
  } catch (e) {
    return null;
  }
}