basename function Null safety

String basename(
  1. String path
)

Gets the part of path after the last separator.

p.basename('path/to/foo.dart'); // -> 'foo.dart'
p.basename('path/to');          // -> 'to'

Trailing separators are ignored.

p.basename('path/to/'); // -> 'to'

Implementation

String basename(String path) => context.basename(path);