$checkedConvert<T> function Null safety

T $checkedConvert<T>(
  1. Map map,
  2. String key,
  3. T castFunc(
    1. dynamic
    )
)

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) {
  try {
    return castFunc(map[key]);
  } on CheckedFromJsonException {
    rethrow;
  } catch (error, stack) {
    throw CheckedFromJsonException._(error, stack, map, key);
  }
}