CardSettingsInt constructor

CardSettingsInt({
  1. Key? key,
  2. String label = 'Label',
  3. TextAlign? labelAlign,
  4. double? labelWidth,
  5. TextAlign? contentAlign,
  6. String? hintText,
  7. int initialValue = 0,
  8. Icon? icon,
  9. Widget? requiredIndicator,
  10. String? unitLabel,
  11. int maxLength = 10,
  12. bool visible = true,
  13. bool enabled = true,
  14. bool autofocus = false,
  15. bool obscureText = false,
  16. bool autocorrect = false,
  17. AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
  18. FormFieldValidator<int>? validator,
  19. FormFieldSetter<int>? onSaved,
  20. ValueChanged<int?>? onChanged,
  21. TextEditingController? controller,
  22. FocusNode? focusNode,
  23. TextInputAction? inputAction,
  24. FocusNode? inputActionNode,
  25. TextInputType? keyboardType,
  26. TextStyle? style,
  27. MaxLengthEnforcement? maxLengthEnforcement = MaxLengthEnforcement.enforced,
  28. ValueChanged<String>? onFieldSubmitted,
  29. List<TextInputFormatter>? inputFormatters,
  30. bool? showMaterialonIOS,
  31. EdgeInsetsGeometry? fieldPadding,
})

Implementation

CardSettingsInt({
  Key? key,
  String label = 'Label',
  TextAlign? labelAlign,
  double? labelWidth,
  TextAlign? contentAlign,
  String? hintText,
  int initialValue = 0,
  Icon? icon,
  Widget? requiredIndicator,
  String? unitLabel,
  int maxLength = 10,
  bool visible = true,
  bool enabled = true,
  bool autofocus = false,
  bool obscureText = false,
  bool autocorrect = false,
  AutovalidateMode autovalidateMode = AutovalidateMode.onUserInteraction,
  FormFieldValidator<int>? validator,
  FormFieldSetter<int>? onSaved,
  ValueChanged<int?>? onChanged,
  TextEditingController? controller,
  FocusNode? focusNode,
  TextInputAction? inputAction,
  FocusNode? inputActionNode,
  TextInputType? keyboardType,
  TextStyle? style,
  MaxLengthEnforcement? maxLengthEnforcement = MaxLengthEnforcement.enforced,
  ValueChanged<String>? onFieldSubmitted,
  List<TextInputFormatter>? inputFormatters,
  bool? showMaterialonIOS,
  EdgeInsetsGeometry? fieldPadding,
}) : super(
        key: key,
        label: label,
        hintText: hintText,
        labelAlign: labelAlign,
        labelWidth: labelWidth,
        showMaterialonIOS: showMaterialonIOS,
        contentAlign: contentAlign,
        initialValue: initialValue.toString(),
        unitLabel: unitLabel,
        icon: icon,
        requiredIndicator: requiredIndicator,
        maxLength: maxLength,
        visible: visible,
        enabled: enabled,
        autofocus: autofocus,
        obscureText: obscureText,
        autocorrect: autocorrect,
        autovalidateMode: autovalidateMode,
        fieldPadding: fieldPadding,
        validator: (value) {
          if (validator == null) return null;
          return validator(intelligentCast<int>(value));
        },
        onSaved: (value) {
          if (onSaved == null) return;
          onSaved(intelligentCast<int>(value));
        },
        onChanged: (value) {
          if (onChanged == null) return;
          onChanged(intelligentCast<int?>(value));
        },
        controller: controller,
        focusNode: focusNode,
        inputAction: inputAction,
        inputActionNode: inputActionNode,
        keyboardType:
            keyboardType ?? TextInputType.numberWithOptions(decimal: false),
        style: style,
        maxLengthEnforcement: maxLengthEnforcement,
        onFieldSubmitted: onFieldSubmitted,
        inputFormatters: [
          LengthLimitingTextInputFormatter(maxLength),
          FilteringTextInputFormatter.allow(RegExp("[0-9]+")),
        ],
      );