Field constructor

Field({
  1. required String name,
  2. required ItemType type,
  3. required bool isRequired,
  4. required bool ignore,
  5. required bool includeFromJson,
  6. required bool includeToJson,
  7. required bool includeIfNull,
  8. required bool nonFinal,
  9. required bool ignoreEquality,
  10. String? description,
  11. String? unknownEnumValue,
  12. String? fromJson,
  13. String? toJson,
  14. String? defaultValue,
  15. bool disallowNull = false,
  16. String? jsonKey,
})

Implementation

Field({
  required String name,
  required this.type,
  required this.isRequired,
  required this.ignore,
  required this.includeFromJson,
  required this.includeToJson,
  required this.includeIfNull,
  required this.nonFinal,
  required this.ignoreEquality,
  this.description,
  this.unknownEnumValue,
  this.fromJson,
  this.toJson,
  this.defaultValue,
  this.disallowNull = false,
  String? jsonKey,
})  : serializedName = jsonKey ?? name,
      name =
          CaseUtil(KeywordHelper.instance.getCorrectKeyword(name)).camelCase;