uninstallPlugin method
Uninstalls plugin: invokes Plugin.uninstall, tears down every
dependency in its child scope (cascading ServiceMixin.dispose() via
the standard unregister hook), then drops the child scope itself.
No-op if plugin is not installed.
Implementation
Resolvable<Unit> uninstallPlugin(Plugin plugin) {
if (!hasPlugin(plugin)) return syncUnit();
final scope = child(groupEntity: plugin.id);
return plugin
.uninstall(scope)
.then((_) => scope.unregisterAll())
.flatten()
.then((_) {
unregisterChild(groupEntity: plugin.id).end();
return Unit();
});
}