ConflictDetector class
Pre-flight conflict detector for InstallTransaction.
Before committing a set of InstallOperations, detect inspects each operation that would write or overwrite a file and determines whether the current on-disk state is safe to overwrite automatically.
Detection reads from two JSON sources:
<projectRoot>/.artisan/installed/<pluginName>.json-- per-plugin record that storesstubHashes(absolute path to md5 hex string).<projectRoot>/.artisan/installed/INDEX.json-- global shared-file index (V1: existence check only; absence of this file causes any unrecorded file to be treated as an'unmanaged-file'conflict).
Usage
final detector = ConflictDetector(ctx);
final conflicts = detector.detect(ops, pluginName: 'firebase_messaging');
if (conflicts.isNotEmpty) {
// Surface to user or pass --force to bypass.
}
Constructors
- ConflictDetector(InstallContext ctx)
-
Creates a ConflictDetector bound to
ctxfor filesystem and path resolution.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
detect(
List< InstallOperation> ops, {required String pluginName}) → List<FileConflict> -
Inspects
opsand returns any file conflicts that would need user confirmation (or a--forceflag) before committing. -
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