IntField constructor
IntField({
- Key? key,
- required String placeholder,
- String? hintText,
- ValueChanged<
int?> ? onChanged, - ValueChanged<
int?> ? onSaved, - String? helperText,
- VoidCallback? onSubmit,
- NumberFieldConstraint<
int> ? constraint, - bool isRequired = true,
- String? requiredText,
- int? initialValue,
- List<
TextInputFormatter> ? formatters, - TextInputType? keyboardType,
- TextInputAction? inputAction,
- bool isActive = true,
- bool isDisabled = false,
- bool emitDirty = true,
- bool obscureText = false,
- bool enableSuggestions = true,
- bool autocorrect = true,
- Iterable<
String> ? autofillHints, - Widget? suffix,
Implementation
IntField({
Key? key,
required String placeholder,
String? hintText,
ValueChanged<int?>? onChanged,
ValueChanged<int?>? onSaved,
String? helperText,
VoidCallback? onSubmit,
this.constraint,
bool isRequired = true,
String? requiredText,
int? initialValue,
List<TextInputFormatter>? formatters,
TextInputType? keyboardType,
TextInputAction? inputAction,
bool isActive = true,
bool isDisabled = false,
bool emitDirty = true,
bool obscureText = false,
bool enableSuggestions = true,
bool autocorrect = true,
Iterable<String>? autofillHints,
Widget? suffix,
}) : super(
key: key,
placeholder: placeholder,
hintText: hintText,
onChanged: onChanged,
onSaved: onSaved,
helperText: helperText,
onSubmit: onSubmit,
validator: constraint?.validate,
isRequired: isRequired,
requiredText: requiredText,
initialValue: initialValue,
formatters: formatters = <TextInputFormatter>[
FilteringTextInputFormatter.allow(RegExp(r'\d')),
...(formatters ?? []),
],
keyboardType: TextInputType.numberWithOptions(
signed: constraint?.minValue?.sign == -1,
decimal: false,
),
inputAction: inputAction,
isActive: isActive,
isDisabled: isDisabled,
emitDirty: emitDirty,
obscureText: obscureText,
enableSuggestions: enableSuggestions,
autocorrect: autocorrect,
autofillHints: autofillHints,
suffix: suffix,
);