fromJson static method
Returns a new ServiceModel instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static ServiceModel? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
return ServiceModel(
id: mapValueOfType<int>(json, r'id'),
name: mapValueOfType<String>(json, r'name'),
value: mapValueOfType<double>(json, r'value'),
image: mapValueOfType<String>(json, r'image'),
shared: mapValueOfType<bool>(json, r'shared'),
);
}
return null;
}