$checkedCreate<T> function Null safety

T $checkedCreate<T>(
  1. String className,
  2. Map map,
  3. T constructor(
    1. S converter(
      1. String,
      2. _CastFunction<S>
      )
    ),
  4. {Map<String, String> fieldKeyMap = const {}}
)

Helper function used in generated code when JsonSerializableGenerator.checked is true.

Should not be used directly.

Implementation

T $checkedCreate<T>(
  String className,
  Map map,
  T Function(S Function<S>(String, _CastFunction<S>) converter) constructor, {
  Map<String, String> fieldKeyMap = const {},
}) {
  Q _checkedConvert<Q>(String key, _CastFunction<Q> convertFunction) =>
      $checkedConvert<Q>(map, key, convertFunction);

  return $checkedNew(
    className,
    map,
    () => constructor(_checkedConvert),
    fieldKeyMap: fieldKeyMap,
  );
}