fileExt function

String? fileExt(
  1. FileSystemEntity entity
)

Return the file's extension without the period. This will return null if there is no extension.

Implementation

String? fileExt(FileSystemEntity entity) {
  final name = fileName(entity);
  final index = name.indexOf('.');
  return index != -1 && index < name.length ? name.substring(index + 1) : null;
}