The last segment of uri's path — a file's or folder's own name.
uri
String nameOf(Uri uri) { final segments = absolute(uri).pathSegments.where((s) => s.isNotEmpty); return segments.isEmpty ? '' : segments.last; }