basename method

String basename(
  1. String path
)

Gets the part of path after the last separator on the context's platform.

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

Trailing separators are ignored.

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

Implementation

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