FieldModel constructor
const
FieldModel(
- String key,
- FieldType type, {
- String? dartName,
- String? reference,
- Object? $default,
- String? doc,
- bool? required,
- bool? nullable,
- bool? copy,
- FieldSerialization? serialize,
- bool? deserialize,
- bool? compare,
- FieldEquality? equality,
- bool? toString,
- bool? convert,
- bool? checkType,
- Object? checkTypeDefault,
- 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;