FormItem<V> constructor
FormItem<V> ({
- required String hint,
- String header = '',
- FormType type = FormType.text,
- bool required = true,
- bool editable = true,
- bool visible = true,
- bool inRow = false,
- bool breakRow = false,
- bool breakCol = false,
- int? maxSelect = -1,
- int? maxItems = -1,
- double? widgetWidth,
- List<
V> ? options, - ValueStream<
List< ? optionsStream,V> > - ArrayMapping? arrayMapping,
- ObjectMapping? objectMapping,
- required bool validation(
- dynamic value
- required V? value,
- String kind = '',
- String? label,
- List<
EditorType> editorTypes = const [EditorType.text], - Iterable<
String> ? autofillHints = const <String>[], - Widget customBuilder(
- BuildContext,
- V? value,
- dynamic onValueChange(
- V?
- Widget customArrayBuilder()?,
- Map<
String, dynamic> factory()?, - bool hasSelect = true,
- bool hasDelete = true,
- bool hasColor = false,
- bool hasImage = false,
- bool hasAction = false,
- Stream<
bool> ? visibilityStream, - dynamic onChange(
- V?
- Widget suffix(
- void ()
- dynamic onTap()?,
- WidgetSize? size,
- String titleCancel = 'Cancel',
- String titleConfirm = 'Ok',
- Widget previewBuilder()?,
- double? maxValue,
- double? minValue,
- bool showFacility = true,
- List<
TextInputFormatter> ? inputFormatters, - dynamic transform(
- V?
- String? errorMessage,
- Widget? labelWidget,
- IconData? prefix,
- Widget imagePathWidget()?,
Implementation
FormItem({
required this.hint,
this.header = '',
this.type = FormType.text,
this.required = true,
this.editable = true,
this.visible = true,
this.inRow = false,
this.breakRow = false,
this.breakCol = false,
this.maxSelect = -1,
this.maxItems = -1,
this.widgetWidth,
this.options,
this.optionsStream,
this.arrayMapping,
this.objectMapping,
required this.validation,
required this.value,
this.kind = '',
this.label,
this.editorTypes = const [EditorType.text],
this.autofillHints = const <String>[],
this.customBuilder,
this.customArrayBuilder,
this.factory,
this.hasSelect = true,
this.hasDelete = true,
this.hasColor = false,
this.hasImage = false,
this.hasAction = false,
this.visibilityStream,
this.onChange,
this.suffix,
this.onTap,
this.size,
this.titleCancel = 'Cancel',
this.titleConfirm = 'Ok',
this.previewBuilder,
this.maxValue,
this.minValue,
this.showFacility = true,
this.inputFormatters,
this.transform,
this.errorMessage,
this.labelWidget,
this.prefix,
this.imagePathWidget,
}) {
assert(((type == FormType.image || type == FormType.images) &&
size != null &&
kind.isNotEmpty) ||
type != FormType.custom ||
(this.customBuilder != null && this.objectMapping != null));
}