FieldModel.assertRequired constructor

FieldModel.assertRequired({
  1. List<String>? fieldPath,
  2. dynamic fieldType,
  3. bool? nullable,
  4. List<Map<String, dynamic>>? children,
  5. bool? primaryKey,
  6. bool? foreignKey,
  7. Object? fallback,
  8. String? description,
})

Constructs a new instance of FieldModel, and asserts that all required parameters are not null.

Implementation

factory FieldModel.assertRequired({
  List<String>? fieldPath,
  dynamic? fieldType,
  bool? nullable,
  List<Map<String, dynamic>>? children,
  bool? primaryKey,
  bool? foreignKey,
  Object? fallback,
  String? description,
}) {
  assert(fieldType != null);

  return FieldModel(
    fieldPath: fieldPath,
    fieldType: fieldType,
    nullable: nullable,
    children: children,
    primaryKey: primaryKey,
    foreignKey: foreignKey,
    fallback: fallback,
    description: description,
  );
}