PluginUninstallCommand class
plugin:uninstall <name>, reverse a manifest-driven plugin install.
Mirror image of PluginInstallCommand:
- 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. - Resolves and parses the plugin's
install.yaml(still on disk because the package itself is still a pubspec dep at uninstall time). - Optionally prompts the operator to confirm a destructive op (unless
--forceor--non-interactiveis set). - On
--dry-run, prints the planned reverse ops via DryRunRenderer and exits without touching the filesystem. - Otherwise, delegates to ManifestInstaller.uninstall which derives the reverse InstallOperations from the record, commits a fresh reverse transaction, and deletes the record on Success.
- Finally, removes the plugin's
importline +registerProviderline frombin/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
-
- Object
- ArtisanCommand
- ArtisanInstallCommand
- PluginUninstallCommand
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 listnext to name).no setteroverride - hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Dispatch key. Colons (
:) act as namespace prefixes forartisan listgrouping (e.g.dusk:snapgroups underdusk).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
truewhen the operator passed--dry-run.inherited -
isForce(
ArtisanContext ctx) → bool -
Returns
truewhen the operator passed--force.inherited -
isNonInteractive(
ArtisanContext ctx) → bool -
Returns
truewhen the operator passed--non-interactive.inherited -
isSkipBootstrap(
ArtisanContext ctx) → bool -
Returns
truewhen 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/nodecision. 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.yamllocation, ornullwhen 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