fileExtensionFromURL static method

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

extract the file extension from url

accepts file url split the url and find the last . and extract the extension from there

Implementation

static String fileExtensionFromURL({required String url}) {
  String extension = url.split(".").last;
  return extension;
}