PluginOperationsService class
Core plugin operations — library functions that can be used by both CLI commands and interactive UI.
Functions in this class:
- Do NOT call exit
- Do NOT write to console
- Return result objects indicating success/failure with messages
- Can throw errors for unexpected failures
Constructors
-
PluginOperationsService({required Future<
List< loadAllPlugins(), required Future<LoadedPlugin> >PluginMarketplaceEntry?> getPluginById(String), required Map<String, bool> ? getSettingsEnabledPlugins(String source), required void updateSettings(String source, Map<String, Object?> update), required void clearAllCaches(), required InstalledPluginsV2 loadInstalledPluginsV2(), required void removePluginInstallation(String pluginId, PluginScope scope, String? projectPath), required Future<void> markVersionOrphaned(String installPath), required void deletePluginOptions(String pluginId), required Future<void> deletePluginDataDir(String pluginId), required List<String> findReverseDependents(String pluginId, List<LoadedPlugin> allPlugins), required bool isPluginBlockedByPolicy(String pluginId), required String getOriginalCwd(), required Set<String> getManagedPluginNames()})
Properties
- clearAllCaches → void Function()
-
final
-
deletePluginDataDir
→ Future<
void> Function(String pluginId) -
final
- deletePluginOptions → void Function(String pluginId)
-
final
-
findReverseDependents
→ List<
String> Function(String pluginId, List<LoadedPlugin> allPlugins) -
final
-
getManagedPluginNames
→ Set<
String> Function() -
final
- getOriginalCwd → String Function()
-
final
-
getPluginById
→ Future<
PluginMarketplaceEntry?> Function(String) -
final
-
getSettingsEnabledPlugins
→ Map<
String, bool> ? Function(String source) -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPluginBlockedByPolicy → bool Function(String pluginId)
-
final
-
loadAllPlugins
→ Future<
List< Function()LoadedPlugin> > -
final
- loadInstalledPluginsV2 → InstalledPluginsV2 Function()
-
final
-
markVersionOrphaned
→ Future<
void> Function(String installPath) -
final
- removePluginInstallation → void Function(String pluginId, PluginScope scope, String? projectPath)
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
updateSettings
→ void Function(String source, Map<
String, Object?> update) -
final
Methods
-
disableAllPlugins(
) → Future< PluginOperationResult> - Disable all enabled plugins.
-
disablePlugin(
String plugin, [PluginScope? scope]) → Future< PluginOperationResult> - Disable a plugin.
-
enablePlugin(
String plugin, [PluginScope? scope]) → Future< PluginOperationResult> - Enable a plugin.
-
findPluginByIdentifier(
String plugin, List< LoadedPlugin> plugins) → LoadedPlugin? - Find a plugin from loaded plugins by identifier.
-
findPluginInSettings(
String plugin) → ({String pluginId, PluginScope scope})? - Search all editable settings scopes for a plugin ID.
-
getPluginInstallationFromV2(
String pluginId) → ({String? projectPath, PluginScope scope}) - Get the most relevant installation for a plugin from V2 data.
-
getProjectPathForScope(
PluginScope scope) → String? - Get the project path for scopes that are project-specific.
-
installPlugin(
String plugin, [PluginScope scope = PluginScope.user]) → Future< PluginOperationResult> - Install a plugin (settings-first).
-
isPluginEnabledAtProjectScope(
String pluginId) → bool - Check if a plugin is enabled at project scope in settings.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
uninstallPlugin(
String plugin, [PluginScope scope = PluginScope.user, bool deleteDataDirFlag = true]) → Future< PluginOperationResult> - Uninstall a plugin.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited