OverridesTarget class final

Where a tool writes dependency_overrides.

While pubspec_overrides.yaml exists, pub ignores the dependency_overrides in pubspec.yaml completely, so a tool must write to the file pub actually reads (active). When that file is ignored by git (as in the templates), a clone wouldn't have it, so the same block is also written into pubspec.yaml (mirror): inert here, effective everywhere else.

Constructors

OverridesTarget(String active, {String? mirror})
Overrides go to active, and also to mirror when set.
const

Properties

active → String
The file pub reads overrides from.
final
files → List<String>
Both files, active first.
no setter
hashCode → int
The hash code for this object.
no setterinherited
mirror → String?
The committed file that also gets them, when active isn't committed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

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 Methods

detect(JustProject project) → Future<OverridesTarget>
Works out the target for project.
ignoredBy(String text, String relative) → bool
Whether the .gitignore text ignores the file relative (a path from the ignore file's folder, / between parts), as git reads it: *, ? and […] in a name, ** across folders, a leading / anchoring a pattern, a pattern of one name matching at any depth, a trailing / matching only folders (a folder on the file's way), and the last matching line deciding — a ! line un-ignores.
isGitIgnored(JustProject project, String relative) → Future<bool>
Whether git ignores relative in project: asks git, and — where git isn't installed, or the project isn't in a repository — reads the project's .gitignore as git would (ignoredBy).