StepInputFormItem constructor

StepInputFormItem({
  1. Key? key,
  2. String? label,
  3. String title = "",
  4. String? subTitle,
  5. String? tipLabel,
  6. String prefixIconType = PrefixIconType.normal,
  7. String error = "",
  8. bool isEdit = true,
  9. bool isRequire = false,
  10. VoidCallback? onAddTap,
  11. VoidCallback? onRemoveTap,
  12. VoidCallback? onTip,
  13. int? value,
  14. int maxLimit = 10,
  15. int minLimit = 0,
  16. OnBrnFormValueChanged? onChanged,
  17. bool canManualInput = false,
  18. TextEditingController? controller,
  19. Color? backgroundColor,
  20. 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));
}