fromJson static method

UpdatedServiceModel? fromJson(
  1. dynamic value
)

Returns a new UpdatedServiceModel instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static UpdatedServiceModel? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();
    return UpdatedServiceModel(
      id: mapValueOfType<int>(json, r'id'),
      name: mapValueOfType<String>(json, r'name'),
      image: mapValueOfType<String>(json, r'image'),
      value: mapValueOfType<double>(json, r'value'),
      shared: mapValueOfType<bool>(json, r'shared'),
    );
  }
  return null;
}