installPlugin method
Installs plugin into a fresh child scope of this container keyed by
plugin.id. Returns the child DI holding the plugin's registrations.
Idempotent: if a plugin with the same id is already installed, this
returns the existing scope without re-running Plugin.install.
Implementation
Resolvable<DI> installPlugin(Plugin plugin) {
if (hasPlugin(plugin)) {
return Sync.okValue(child(groupEntity: plugin.id));
}
final scope = child(groupEntity: plugin.id);
return plugin.install(scope).then((_) => scope);
}