StepInputFormItem constructor
StepInputFormItem({
- Key? key,
- String? label,
- String title = "",
- String? subTitle,
- String? tipLabel,
- String prefixIconType = PrefixIconType.normal,
- String error = "",
- bool isEdit = true,
- bool isRequire = false,
- VoidCallback? onAddTap,
- VoidCallback? onRemoveTap,
- VoidCallback? onTip,
- int? value,
- int maxLimit = 10,
- int minLimit = 0,
- OnBrnFormValueChanged? onChanged,
- bool canManualInput = false,
- TextEditingController? controller,
- Color? backgroundColor,
- FormItemConfig? themeData,
Implementation
StepInputFormItem({
Key? key,
this.label,
this.title = "",
this.subTitle,
this.tipLabel,
this.prefixIconType = PrefixIconType.normal,
this.error = "",
this.isEdit = true,
this.isRequire = false,
this.onAddTap,
this.onRemoveTap,
this.onTip,
this.value,
this.maxLimit = 10,
this.minLimit = 0,
this.onChanged,
this.canManualInput = false,
this.controller,
this.backgroundColor,
this.themeData,
}) : super(key: key) {
if (value != null) {
assert(value! >= minLimit && value! <= maxLimit);
}
if (controller != null) {
int? defaultValue = int.tryParse(controller!.text);
assert(
defaultValue == null ||
(defaultValue >= minLimit && defaultValue <= maxLimit),
'The text or value in the controller is not in the limits.');
}
themeData ??= FormItemConfig();
themeData = BaseThemeConfig.instance
.getConfig(configId: themeData!.configId)
.formItemConfig
.merge(themeData);
themeData =
themeData!.merge(FormItemConfig(backgroundColor: backgroundColor));
}