JustProject class base

A Dart or Flutter project: the folder holding its pubspec.yaml.

Paths are relative to root and use / between parts, as lockfiles and pubspecs write them.

Constructors

JustProject(String root)
The project whose pubspec.yaml is in root.

Properties

exists → bool
Whether this folder holds a pubspec.
no setter
hashCode → int
The hash code for this object.
no setterinherited
root → String
The project folder, absolute, with / between parts and no . or .. parts.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dir(String relative) → Directory
relative as a folder.
file(String relative) → File
relative as a file.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
path(String relative) → String
The absolute path of relative.
pathTo(String absolute) → String
The path from root to absolute: relative — with .. when it is outside the project — whenever both are on the same drive (or share), so a project and what it points at can move together; else absolute.
readProjectFile() → JustProjectFile
The project's just.json, or the defaults when it has none. Throws JsonFormatException (naming the file) when it exists but is not valid.
readText(String relative) → String?
The text of relative, or null when it doesn't exist.
relativeOf(String absolute) → String?
absolute relative to root, or null when it is outside it.
toString() → String
A string representation of this object.
inherited
writeProjectFile(JustProjectFile file) → void
Saves file as the project's just.json.

Operators

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

Static Methods

find(String start) → JustProject?
The project holding start — the nearest folder at or above it with a pubspec.yaml — or null when there is none.

Constants

overrides → const String
The overrides file pub reads instead of the pubspec's overrides (ProjectPaths.overrides).
packagesDir → const String
The folder installed packages go into (ProjectPaths.packagesDir).
projectFile → const String
The project's just.json (ProjectPaths.projectFile): its title, tool set and entry points.
pubspec → const String
The project's pubspec (ProjectPaths.pubspec).
workDir → const String
The tools' scratch folder (ProjectPaths.workDir): transaction journals, staging, the lock.