downloadReels method Null safety

Future<String> downloadReels(
  1. String link
)

Implementation

Future<String> downloadReels(String link) async {
  var linkEdit = link.replaceAll(" ", "").split("/");
  var downloadURL = await http.get(Uri.parse('${linkEdit[0]}//${linkEdit[2]}/${linkEdit[3]}/${linkEdit[4]}' + "/?__a=1"));
  var data = json.decode(downloadURL.body);
  var graphql = data['graphql'];
  var shortcodeMedia = graphql['shortcode_media'];
  var videoUrl = shortcodeMedia['video_url'];
  return videoUrl; // return download link
}