fileName static method

String fileName(
  1. String path
)

Returns the file name (last path segment) of path.

Implementation

static String fileName(String path) {
  final int slash = path.lastIndexOf(RegExp(r'[/\\]'));
  return slash == -1 ? path : path.substring(slash + 1);
}