JsonSerializableGenerator.withDefaultHelpers constructor

JsonSerializableGenerator.withDefaultHelpers(
  1. Iterable<TypeHelper<TypeHelperContext>> typeHelpers, {
  2. JsonSerializable? config,
})

Creates an instance of JsonSerializableGenerator.

typeHelpers provides a set of TypeHelper that will be used along with the built-in helpers: BigIntHelper, DateTimeHelper, DurationHelper, JsonHelper, and UriHelper.

Implementation

factory JsonSerializableGenerator.withDefaultHelpers(
  Iterable<TypeHelper> typeHelpers, {
  JsonSerializable? config,
}) =>
    JsonSerializableGenerator(
      config: config,
      typeHelpers: List.unmodifiable(
        typeHelpers.followedBy(Settings.defaultHelpers),
      ),
    );