getRepository function

Future<RepositoryBase?> getRepository(
  1. String appId,
  2. String searchPluginName,
  3. String searchComponentName
)

Implementation

Future<RepositoryBase?> getRepository(
    String appId, String searchPluginName, String searchComponentName) async {
  var pluginsWithComponents = retrievePluginsWithComponents();
  for (var pluginsWithComponent in pluginsWithComponents) {
    var pluginName = pluginsWithComponent.name;
    for (var componentSpec in pluginsWithComponent.componentSpec) {
      var componentName = componentSpec.name;
      if ((searchPluginName == pluginName) &&
          (searchComponentName == componentName)) {
        return componentSpec.retrieveRepository(appId: appId);
      }
    }
  }
  return null;
}