DartProject class Null safety

Constructors

DartProject.create({required String pathTo, required String templateName})
Create a dart project on the file system at pathTo from the template named templateName.
factory
DartProject.fromCache(String name, String version)
Loads the project from the dart pub cache named name for the version version. e.g. ~/.pub-cache/hosted/pub.dartlang.org/dswitch-4.0.1
DartProject.fromPath(String pathToSearchFrom, {bool search = true})
Load a dart project from the given directory. [...]

Properties

hasAnalysisOptions bool
Returns true if the project has an 'analysis_options.yaml' file.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
hasPubSpec bool
Returns true if the project contains a pubspec.yaml.
read-only
isFlutterProject bool
Returns true if this project is a flutter projects. [...]
read-only
isReadyToRun bool
there is a 'generated' date stamp in the .json file which might be more definitive. Returns true if the project is in state when any of its scripts can be run. [...]
read-only
pathToBinDir String
Absolute path to the project's 'bin' directory.
read-only
pathToDartToolDir String
Absolute path to the project's '.dart_tool' directory.
read-only
pathToProjectRoot String
Absolute path to the project's root diretory.
read-only
pathToPubSpec String
Absolute pathto the project's pubspec.yaml
read-only
pathToTestDir String
Absolute path to the project's 'test' directory.
read-only
pathToToolDir String
Absolute path to the project's 'tool' directory.
read-only
pubSpec PubSpec
reads and returns the project's virtual pubspec and returns it.
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clean() → void
Removes any of the dart build artifacts so you have a clean directory. We do this recursively so all subdirectories will also be purged. [...]
compile({bool install = false, bool overwrite = false}) → void
Compiles all dart scripts in the project. If you set install to true then each compiled script is added to your PATH by copying it into ~/.dcli/bin. install defaults to false. [...]
doctor() → void
Used by the dcli doctor command to print out the DartProjects details.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
warmup({bool background = false, bool upgrade = false}) → void
Prepare the project so it can be run. This essentially means that we run pub get however if the project hasn't been initialised then we initialise the project as well. if background is set to true then we run the build as a background process. background defaults to false. [...]

Operators

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

Static Properties

current DartProject
If you
@Deprecated('Use DartProject.self'), read-only
self DartProject
Returns the instance of the currently running DartProject. [...]
read-only

Static Methods

findProject(String pathToSearchFrom, {bool search = true}) DartProject?
Looks for a pubspec.yaml and if found returns a DartProject. [...]