Check out example codes for "get file name from path dart". It will help you in understanding the concepts better.

Code Example 1

void main() {
  var completePath = "/dev/dart/work/hello/app.dart";
  var fileName = (completePath.split('/').last);
  var filePath = completePath.replaceAll("/$fileName", '');
  print(fileName);
  print(filePath);
}

Learn ReactJs, React Native from akashmittal.com