IntField class

Integer Form Field.

The Integer field only accepts integer values. Letters and most symbols cannot be entered into this type of field. However, the negative sign ('-') and the positive sign ('+') are allowed.

Non-numeric characters must somehow be filtered out so that they do not appear in the form field. This is accomplished by setting the following:

  • Int as the validator to limit input data to integer values
  • the inputFormatters to deny non-digt characters except the minus '-' and plus '+' signs.
  • TextInputType.numberWithOptions as the keyboardType.
Inheritance

Constructors

IntField({bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? initialValue, TextEditingController? controller, InputDecoration? decoration, TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, List<TextInputFormatter>? inputFormatters, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Integer Numbers Form Field.
IntField.max(int max, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? large, String? initialValue, TextEditingController? controller, InputDecoration? decoration = const InputDecoration(), TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Constrains data to integer values that are less than or equal to max.
IntField.min(int min, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? small, String? initialValue, TextEditingController? controller, InputDecoration? decoration, TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Constrains data to integer numbers greater than or equal to min.
IntField.neg({bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? pos, String? initialValue, TextEditingController? controller, InputDecoration? decoration, TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Constrains entered data to negative integers.
IntField.pos({bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? neg, String? initialValue, TextEditingController? controller, InputDecoration? decoration, TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Constrains data to positive integers.
IntField.range(int min, int max, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? small, String? large, String? initialValue, TextEditingController? controller, InputDecoration? decoration, TextInputAction? textInputAction, TextStyle? style, TextDirection? textDirection, TextAlign textAlign = TextAlign.start, bool readOnly = false, String obscuringCharacter = '•', bool obscureText = false, bool autocorrect = true, int? maxLength, ValueChanged<String>? onChanged, VoidCallback? onEditingComplete, ValueChanged<String>? onFieldSubmitted, FormFieldSetter<String>? onSaved, bool? enabled, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Constrains data to integer numbers within the range min–max.

Properties

hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) BasicTextField
Builds a BasicTextField suitable for integer values.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited