DigitField class Null safety

Digit-only Form Field.

Non-digit characters must somehow be filtered out so that they do not appear in the form field. To achieve this, this widget:

Inheritance

Constructors

DigitField({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, EdgeInsets scrollPadding = const EdgeInsets.all(20.0), bool enableInteractiveSelection = true, AutovalidateMode? autovalidateMode, Key? key})
Digit-only Form Field. [...]
DigitField.len(int len, {bool trim = false, FormFieldValidator<String>? validator, String? malformed, String? blank, String? diff, 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})
Digit-only form field with length constraint. [...]
DigitField.max(int max, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? long, 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})
Digit-only form field with maximum length constraint. [...]
DigitField.min(int min, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? short, 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})
Digit-only form field with minimum length constraint. [...]
DigitField.range(int min, int max, {bool trim = false, FormFieldValidator<String>? validator, String? blank, String? malformed, String? short, String? long, 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})
Digit-only form field with length range constraint. [...]

Properties

hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

build(BuildContext context) BasicTextField
Builds a BasicTextField suitable for digit-only 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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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. [...]
@nonVirtual, inherited