name property

String get name

Gets the part of path after the last separator.

File('path/to/foo.dart').name; // -> 'foo.dart'
Directory('path/to').name;          // -> 'to'

Trailing separators are ignored.

Directory('path/to/').name; // -> 'to'

Implementation

String get name => path_helper.basename(path);