fileBaseName function

String fileBaseName(
  1. String path
)

Last path segment, for both / and \ separated paths.

Implementation

String fileBaseName(String path) => path.split(RegExp(r'[\\/]')).last;