ProjectAgent class

A CommandLineAgent with additional behavior for managing a 'Dart package' directory.

Inheritance

Constructors

ProjectAgent(String name, {Map<String, dynamic> dependencies = const {}, Map<String, dynamic> devDependencies = const {}})
Creates a new package and terminal on that package's working directory.
ProjectAgent.existing(Uri uri)

Properties

hashCode int
The hash code for this object.
no setterinherited
libraryDirectory Directory
Directory of lib/ in project
no setter
name String
Name of this project
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
srcDirectory Directory
Directory of lib/src/ in project
no setter
testDirectory Directory
Directory of test/ in project
no setter
workingDirectory Directory
finalinherited

Methods

addLibraryExport(String exportUri) → void
Adds exportUri as an export to the main library file of this project.
addLibraryFile(String fileName, String contents, {bool export = true}) → void
Creates a new $name.dart file in lib/
addOrReplaceFile(String path, String contents, {List<String> imports = const []}) → void
Adds or replaces file in this terminal's working directory
inherited
addSourceFile(String fileName, String contents, {bool export = true}) → void
Creates a new $name.dart file in lib/src/
getDependencies({bool offline = true}) Future<ProcessResult>
inherited
getFile(String path) File?
inherited
modifyFile(String path, String contents(String current)) → void
Updates the contents of an existing file
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

projectsDirectory Directory
Temporary directory where projects are stored ('$PWD/tmp')
no setter

Static Methods

tearDownAll() → void
Deletes projectsDirectory. Call after tests are complete