basename function

String basename(
  1. String path
)

Extracts the basename from a file path.

Implementation

String basename(String path) {
  return Uri.file(path).pathSegments.lastWhere((s) => s.isNotEmpty);
}