AttributeFormField<T extends Object>.ofForm constructor

AttributeFormField<T extends Object>.ofForm({
  1. Key? key,
  2. required FormController form,
  3. dynamic label,
  4. dynamic placeholder,
  5. dynamic attribute,
  6. InputDecoration? decoration,
  7. FormValueChanged<T?>? onChange,
  8. required bool isRequired,
  9. SunnyFormFieldBuilder<T?>? builder,
  10. bool? isReadOnly,
  11. bool captureNestedPaths = true,
  12. bool? enabled,
  13. AttributeAccepter<T?>? onReadOnlyTapped,
  14. FieldConverter<T?>? converter,
})

Creates an attribute form field, pulling initial value from the form

Implementation

AttributeFormField.ofForm({
  Key? key,
  required FormController form,
  dynamic label,
  dynamic placeholder,
  dynamic attribute,
  InputDecoration? decoration,
  FormValueChanged<T?>? onChange,
  required bool isRequired,

  /// This builder should only build the raw input, without any extra stuff, like errors, help text,
  /// labels, or otherwise.  By default, a basic text field will be created
  SunnyFormFieldBuilder<T?>? builder,
  bool? isReadOnly,
  bool captureNestedPaths = true,
  bool? enabled,
  AttributeAccepter<T?>? onReadOnlyTapped,
  FieldConverter<T?>? converter,
}) : super(
        key: key,
        label: label,
        placeholder: placeholder,
        attribute: attribute,
        builder: builder,
        isReadOnly: isReadOnly,
        form: form,
        isRequired: isRequired,
        onChange: onChange,
        enabled: enabled,
        decoration: decoration,
        captureNestedPaths: captureNestedPaths,
        onReadOnlyTapped: onReadOnlyTapped,
        initialValue: form.get(JsonPath.of(attribute)),
//          initialValue: initialValue ??
//              converter?.call(controller.get(JsonPath.of(attribute))) ??
//              controller.get(JsonPath.of(attribute)),
        converter: converter,
      );