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