TxArrayFormField<T>.builder constructor

TxArrayFormField<T>.builder({
  1. required ArrayFormFieldItemBuilder<T> itemBuilder,
  2. required ValueMapper<int, T> defaultValue,
  3. ButtonStyle? addButtonStyle,
  4. ButtonStyle? actionsButtonStyle,
  5. int? limit,
  6. bool? sortable,
  7. bool? insertable,
  8. FocusNode? focusNode,
  9. String? hintText,
  10. TextAlign? textAlign,
  11. Key? key,
  12. FormFieldSetter<List<T>>? onSaved,
  13. FormFieldValidator<List<T>>? validator,
  14. List<T>? initialValue,
  15. bool? enabled,
  16. AutovalidateMode? autovalidateMode = AutovalidateMode.onUserInteraction,
  17. String? restorationId,
  18. InputDecoration? decoration,
  19. ValueChanged<List<T>?>? onChanged,
  20. bool? required,
  21. Widget? label,
  22. String? labelText,
  23. TextAlign? labelTextAlign,
  24. TextOverflow? labelOverflow,
  25. EdgeInsetsGeometry? padding,
  26. FieldActionsBuilder<List<T>>? actionsBuilder,
  27. TextStyle? labelStyle,
  28. double? horizontalGap,
  29. Color? tileColor,
  30. Axis? layoutDirection,
  31. TxFormFieldBuilder<List<T>>? trailingBuilder,
  32. Widget? leading,
  33. VisualDensity? visualDensity,
  34. ShapeBorder? shape,
  35. Color? iconColor,
  36. Color? textColor,
  37. TextStyle? leadingAndTrailingTextStyle,
  38. GestureTapCallback? onTap,
  39. double? minLeadingWidth,
  40. bool? dense,
  41. bool? colon,
  42. double? minLabelWidth,
  43. Color? focusColor,
  44. double? minVerticalPadding,
})

通过自增子项构造一个自增 Form 组件

Implementation

TxArrayFormField.builder({
  required ArrayFormFieldItemBuilder<T> itemBuilder,
  required ValueMapper<int, T> defaultValue,
  ButtonStyle? addButtonStyle,
  ButtonStyle? actionsButtonStyle,
  int? limit,
  bool? sortable,
  bool? insertable,
  FocusNode? focusNode,
  String? hintText,
  TextAlign? textAlign,
  super.key,
  super.onSaved,
  FormFieldValidator<List<T>>? validator,
  super.initialValue,
  super.enabled,
  super.autovalidateMode,
  super.restorationId,
  super.decoration,
  super.onChanged,
  super.required,
  super.label,
  super.labelText,
  super.labelTextAlign,
  super.labelOverflow,
  super.padding,
  super.actionsBuilder,
  super.labelStyle,
  super.horizontalGap,
  super.tileColor,
  super.layoutDirection,
  super.trailingBuilder,
  super.leading,
  super.visualDensity,
  super.shape,
  super.iconColor,
  super.textColor,
  super.leadingAndTrailingTextStyle,
  super.onTap,
  super.minLeadingWidth,
  super.dense,
  super.colon,
  super.minLabelWidth,
  super.focusColor,
  super.minVerticalPadding,
}) : super(
        builder: (field) => _buildFormFieldByItem(
          field,
          itemBuilder,
          defaultValue,
          addButtonStyle,
          actionsButtonStyle,
          limit,
          sortable,
          insertable,
        ),
        validator: (val) => _validator(val, required, limit, validator),
      );