deserializeFromString static method
Implementation
static dynamic deserializeFromString(String? json, String targetType) {
if (json == null) {
// HTTP Code 204
return null;
}
// Remove all spaces. Necessary for reg expressions as well.
targetType = targetType.replaceAll(' ', '');
if (targetType == 'String') return json;
final decodedJson = jsonDecode(json);
return deserialize(decodedJson, targetType);
}