getFileExtension method

String getFileExtension()

Implementation

String getFileExtension() {
  final uri = Uri.parse(this);
  final segments = uri.pathSegments;
  if (segments.isEmpty) {
    return '';
  }
  String filenameWithExtension = segments.last.toLowerCase();
  return filenameWithExtension.split('.').last;
}