getProvider function

BaseProvider getProvider(
  1. String name
)

Implementation

BaseProvider getProvider(String name) {
  Map<String, dynamic> models = {
    'sensor': {"uri": "sensor", "model": Sensor, "provider": SensorProvider},
    'company': {
      "uri": "company",
      "model": Company,
      "provider": CompanyProvider
    },
  };

  BaseProvider provider = BaseProvider();
  provider.setModel(models[name]['model']);
  provider.setUrl(models[name]['uri']);
  return provider;
}