PluginUninstallCommand class

plugin:uninstall <name>, reverse a manifest-driven plugin install.

Mirror image of PluginInstallCommand:

  1. Verifies an install record exists at <projectRoot>/.artisan/installed/<name>.json. The record is what ManifestInstaller writes on a successful install; without it there is no plan to reverse.
  2. Resolves and parses the plugin's install.yaml (still on disk because the package itself is still a pubspec dep at uninstall time).
  3. Optionally prompts the operator to confirm a destructive op (unless --force or --non-interactive is set).
  4. On --dry-run, prints the planned reverse ops via DryRunRenderer and exits without touching the filesystem.
  5. Otherwise, delegates to ManifestInstaller.uninstall which derives the reverse InstallOperations from the record, commits a fresh reverse transaction, and deletes the record on Success.
  6. Finally, removes the plugin's import line + registerProvider line from bin/artisan.dart, the inverse of the legacy injection PluginInstallCommand performs when no manifest is found.

V1 limitation: only WriteFile / DeleteFile / CopyFile carry full payload in the install record. Every other op type is recorded as a type-only marker. ManifestInstaller.uninstall surfaces a warning for those and skips. The Plugin Authoring Guide documents the trade-off.

Inheritance

Constructors

PluginUninstallCommand()
Public default constructor. Test fixtures subclass + override getProjectRoot / resolveInstallYaml / promptConfirmation to inject deterministic paths and answers.

Properties

baseFlags String
Standard install-command flag fragment interpolated into every concrete subclass's signature.
no setterinherited
boot CommandBoot
Install commands run before the Flutter app boots: no VM Service, no connected isolate. The dispatcher constructs a ArtisanContext.bare.
no setterinherited
description String
One-line description (rendered in artisan list next to name).
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
name String
Dispatch key. Colons (:) act as namespace prefixes for artisan list grouping (e.g. dusk:snap groups under dusk).
no setterinherited
parsedSignature CommandSignature?
Lazy-parsed signature. Cached for the lifetime of the instance.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signature String
Optional Laravel-style signature DSL. When set, name derives from it and configure auto-registers the declared options/flags.
no setteroverride

Methods

buildContext(ArtisanContext ctx) InstallContext
Constructs the production InstallContext wired around ctx.
inherited
configure(ArgParser parser) → void
Auto-applies signature to the parser when set. Override to register extra ArgParser features (mandatory options, aliases, custom value validators). When you override, call super.configure(parser) first if you also use the signature DSL.
inherited
getProjectRoot() String
Resolves the consumer project root. Hook for test subclasses; production path defers to FileHelper.findProjectRoot.
handle(ArtisanContext ctx) Future<int>
Execute the command. Returns the process exit code.
override
isDryRun(ArtisanContext ctx) bool
Returns true when the operator passed --dry-run.
inherited
isForce(ArtisanContext ctx) bool
Returns true when the operator passed --force.
inherited
isNonInteractive(ArtisanContext ctx) bool
Returns true when the operator passed --non-interactive.
inherited
isSkipBootstrap(ArtisanContext ctx) bool
Returns true when the operator passed --no-bootstrap.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pluginName(ArtisanContext ctx) String
Identifier of the plugin this install command targets.
override
promptConfirmation(ArtisanContext ctx, String pluginName) bool
Interactive confirmation step. Returns the operator's yes/no decision. Hook for test subclasses; production path delegates to InstallContext.prompt (which wraps the static Prompt.confirm helper).
resolveInstallYaml(String pluginName) Future<String?>
Resolves the plugin's install.yaml location, or null when the plugin ships no manifest (uninstall cannot proceed in that case).
toString() String
A string representation of this object.
inherited

Operators

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