FieldModel constructor

const FieldModel(
  1. String key,
  2. FieldType type, {
  3. String? dartName,
  4. String? reference,
  5. Object? $default,
  6. String? doc,
  7. bool? required,
  8. bool? nullable,
  9. bool? copy,
  10. FieldSerialization? serialize,
  11. bool? deserialize,
  12. bool? compare,
  13. FieldEquality? equality,
  14. bool? toString,
  15. bool? convert,
  16. bool? checkType,
  17. Object? checkTypeDefault,
  18. bool? castIterable,
})

The model to contain the options of each field of the ClassModel.

Implementation

const FieldModel(
  this.key,
  this.type, {
  final String? dartName,
  final String? reference,
  this.$default,
  this.doc,
  final bool? required,
  final bool? nullable,
  final bool? copy,
  final FieldSerialization? serialize,
  final bool? deserialize,
  final bool? compare,
  final FieldEquality? equality,
  final bool? toString,
  final bool? convert,
  final bool? checkType,
  this.checkTypeDefault,
  final bool? castIterable,
})  : assert(key != '', 'Key can not be empty'),
      dartName = dartName ?? '',
      reference = reference ?? '',
      required = required ?? ($default == null && !(nullable ?? false)),
      nullable = nullable ?? false,
      copy = copy ?? true,
      serialize = serialize ?? FieldSerialization.all,
      deserialize = deserialize ?? true,
      compare = compare ?? false,
      equality = equality ?? FieldEquality.ordered,
      $toString = toString ?? true,
      convert = convert ?? true,
      checkType = checkType ?? true,
      castIterable = castIterable ?? false;