withDefaults method

JsonSerializable withDefaults ()

Returns a new JsonSerializable instance with fields equal to the corresponding values in this, if not null.

Otherwise, the returned value has the default value as defined in defaults.

Implementation

JsonSerializable withDefaults() => JsonSerializable(
      anyMap: anyMap ?? defaults.anyMap,
      checked: checked ?? defaults.checked,
      createFactory: createFactory ?? defaults.createFactory,
      createToJson: createToJson ?? defaults.createToJson,
      disallowUnrecognizedKeys:
          disallowUnrecognizedKeys ?? defaults.disallowUnrecognizedKeys,
      explicitToJson: explicitToJson ?? defaults.explicitToJson,
      fieldRename: fieldRename ?? defaults.fieldRename,
      ignoreUnannotated: ignoreUnannotated ?? defaults.ignoreUnannotated,
      includeIfNull: includeIfNull ?? defaults.includeIfNull,
      nullable: nullable ?? defaults.nullable,
    );