DependencyConfig.fromJson constructor
DependencyConfig.fromJson(
- Map json
Implementation
factory DependencyConfig.fromJson(Map<dynamic, dynamic> json) {
ModuleConfig? moduleConfig;
DisposeFunctionConfig? disposeFunction;
List<ImportableType> dependsOn = [];
List<InjectedDependency> dependencies = [];
if (json['moduleConfig'] != null) {
moduleConfig = ModuleConfig.fromJson(json['moduleConfig']);
}
if (json['disposeFunction'] != null) {
disposeFunction = DisposeFunctionConfig.fromJson(json['disposeFunction']);
}
if (json['dependencies'] != null) {
json['dependencies'].forEach((v) {
dependencies.add(InjectedDependency.fromJson(v));
});
}
if (json['dependsOn'] != null) {
json['dependsOn'].forEach((v) {
dependsOn.add(ImportableType.fromJson(v));
});
}
return DependencyConfig(
type: ImportableType.fromJson(json['type']),
typeImpl: ImportableType.fromJson(json['typeImpl']),
dependencies: dependencies,
injectableType: json['injectableType'],
instanceName: json['instanceName'],
signalsReady: json['signalsReady'],
environments: json['environments']?.cast<String>(),
constructorName: json['constructorName'],
postConstruct: json['postConstruct'],
isAsync: json['isAsync'] as bool,
canBeConst: json['canBeConst'] as bool,
dependsOn: dependsOn,
preResolve: json['preResolve'] as bool,
postConstructReturnsSelf: json['postConstructReturnsSelf'] as bool,
moduleConfig: moduleConfig,
disposeFunction: disposeFunction,
orderPosition: json['orderPosition'] as int,
scope: json['scope'] as String?,
);
}