$checkedCreate<T> function

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

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