fileName property

String? fileName

Returns the name of the file. This typically is the part of the path after the last / or \.

Implementation

String? get fileName {
  final parsedPath = '/' + path!.replaceAll(r'\', r'/');
  return parsedPath.substring(parsedPath.lastIndexOf('/') + 1);
}