$checkedConvert<T> function
T
$checkedConvert<T>(})
Helper function used in generated code when
JsonSerializableGenerator.checked
is true
.
Should not be used directly.
Implementation
T $checkedConvert<T>(
Map map,
String key,
T Function(dynamic) castFunc, {
Object? Function(Map, String)? readValue,
}) {
try {
return castFunc(readValue == null ? map[key] : readValue(map, key));
} on CheckedFromJsonException {
rethrow;
} catch (error, stack) {
throw CheckedFromJsonException._(error, stack, map, key);
}
}