AutoFieldWidget constructor

AutoFieldWidget({
  1. required String id,
  2. required String label,
  3. String initValue = "",
  4. bool enabled = true,
  5. bool hidden = false,
  6. List<FieldValidation> validations = const [],
  7. List<FieldTrigger> triggers = const [],
  8. Key? key,
})

Implementation

AutoFieldWidget({
  required this.id,
  required this.label,
  this.initValue = "",
  this.enabled = true,
  this.hidden = false,
  this.validations = const [],
  this.triggers = const [],
  super.key,
}) {
  assert(validations.where((e) => e.value == "@$id").isEmpty,
      "Field validation cannot refrence itself");
  assert(triggers.where((e) => e.fieldId == id).isEmpty,
      "Triggers cannot refrence itself");

  _valuePointer.value = initValue;
  isHidden.value = hidden;
  isEnabled.value = enabled;
}