$checkedCreate<T> function Null safety

T $checkedCreate<T>(
  1. String className,
  2. Map map,
  3. T constructor(
    1. S (
      1. String,
      2. _CastFunction<S> ,
      3. {Object? readValue(
        1. Map,
        2. String
        )?}
      )
    ),
  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>, {
      Object? Function(Map, String)? readValue,
    }),
  )
      constructor, {
  Map<String, String> fieldKeyMap = const {},
}) {
  Q _checkedConvert<Q>(
    String key,
    _CastFunction<Q> convertFunction, {
    Object? Function(Map, String)? readValue,
  }) =>
      $checkedConvert<Q>(map, key, convertFunction, readValue: readValue);

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