dirname property

  1. @override
String dirname
override

Gets the part of this entity's path before the last separator.

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

Trailing separators are ignored.

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

Implementation

@override
String get dirname => fileSystem.path.dirname(path);