fileNameFromURL static method

String fileNameFromURL({
  1. required String url,
})

url functions

accepts file url extract the file name from url split the url find the last/ and extract the file name from there

Implementation

static String fileNameFromURL({required String url}) {
  String temp = url.substring(url.lastIndexOf('/') + 1);
  url = temp;
  return url;
}