getFileName method

String getFileName(
  1. String path
)

从路径取文件名(去掉目录与扩展名)。

Implementation

String getFileName(String path) {
  final split = path.split('/');
  final fileName = split.last.split('.').first;
  return fileName;
}