tryString2Model<T> function
Implementation
T tryString2Model<T>(String data, T Function(Map<String, dynamic> json) parse, T Function() orElse) {
try {
return parse(jsonDecode(data));
} catch (_) {
return orElse.call();
}
}