FieldInfo class

This is a class to simplify the creation of a form (shown in the examples section)

Constructors

FieldInfo({TextEditingController? controller, String? initialValue, bool? required, String? requiredString, IconData? prefixIcon, String? label, String? innerLabel, String? hint, TextInputType? inputType, bool? multiLine, bool? readOnly, VoidCallback? onTap, IconData? suffixIcon, bool? isObscure, int? maxLines, int? minLines, void onChanged(String input)?, List<TextInputFormatter>? inputFormatters, FormFieldValidator<String>? validator, void onTapOutside(PointerDownEvent pointerDownEvent)?})
FieldInfo.multiLine({TextEditingController? controller, String? initialValue, String? hint, String? innerLabel, String? label, IconData? prefixIcon, IconData? suffixIcon, bool? required, bool? isObscure, String? requiredString, bool? readOnly, VoidCallback? onTap, void onTapOutside(PointerDownEvent pointerDownEvent)?, int? minLines, int? maxLines, FormFieldValidator<String>? validator, List<TextInputFormatter>? inputFormatters, void onChanged(String input)?})
a named constructor that
factory

Properties

controller TextEditingController
The TextEditingController specific for the field of the FieldInfo
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hint String?
The hint shown in the field
getter/setter pair
innerLabel String?
The label shown inside the field to the right of the prefix icon
getter/setter pair
inputFormatters List<TextInputFormatter>?
specifies the formatters of the form field
final
inputType TextInputType?
The keyboard type of the field
getter/setter pair
isObscure bool?
specifies if the field input is obscured
getter/setter pair
label String?
The label shown above the field in bold
getter/setter pair
maxLines int?
specifies max lines for multi-line fields
getter/setter pair
minLines int?
specifies min lines for multi-line fields
getter/setter pair
multiLine bool?
specifies if the field is multiline or not
getter/setter pair
onChanged ↔ (void Function(String input)?)
specifies the onChanged method
getter/setter pair
onTap VoidCallback?
specifies the action to be performed if the field is tapped
getter/setter pair
onTapOutside ↔ (void Function(PointerDownEvent pointerDownEvent)?)
specifies the action to be performed if the outside of the field is tapped
getter/setter pair
prefixIcon IconData?
The prefix icon shown in the field
getter/setter pair
readOnly bool?
specifies if the field is read only
getter/setter pair
required bool?
specifies if the field is required or not if true, a (Required) is concatenated to the label Example: a field with label 'Name' required: true ===> 'Name (Required)' required: false ===> 'Name' if the label is null and the inner label is not null an asterisk will be concatenated to the inner label
getter/setter pair
requiredString String?
specifies what is concatenated to the string if it is required
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
suffixIcon IconData?
The suffix icon shown in the field
getter/setter pair
validator FormFieldValidator<String>?
specifies the validator of the form field
final

Methods

copyWith({TextEditingController? controller, String? initialValue, bool? required, String? requiredString, IconData? prefixIcon, String? label, String? hint, String? innerLabel, TextInputType? inputType, bool? multiLine, bool? isObscure, VoidCallback? onTap, void onTapOutside(PointerDownEvent pointerDownEvent)?, bool? readOnly, IconData? suffixIcon, int? minLines, int? maxLines, FormFieldValidator<String>? validator, List<TextInputFormatter>? inputFormatters, void onChanged(String input)?}) FieldInfo
This method creates a new instance with the specified attributes as the only difference between the previous instance and the new one
dispose() → void
calls the dispose method of the text editing controller do not forget to call it in the dispose method! void dispose() { info.dispose(); super.dispose(); }
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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