TextInputViewModel class abstract

Implemented types

Constructors

TextInputViewModel({dynamic id, String? labelText, String? hintText, String? infoText, bool showInfoTextWhenFocusedOnly, String? errorText, bool swapLabelAndHintTextWhenUnfocused, String inputValue, TextInputAction? textInputAction, TextCapitalization? textCapitalization, String? suffixIconAsset, String? obscuredSuffixIconAsset, bool isInputObscured, String obscuringCharacter, TextInputType? textInputType, bool isReadOnly, bool isHidden, bool isDisabled, bool isHighlighted, bool isSuggestionInput, int maxLines, bool isAutoFocused, bool? showCursorOnlyOnFocus, int? maxLength, AutovalidateMode? autoValidateMode, List<TextInputFormatter>? inputFormatters})
const
factory

Properties

autoValidateMode AutovalidateMode?
no setter
copyWith → _$$TextInputViewModelImplCopyWith<_$TextInputViewModelImpl>
no setter
errorText String?
The text appearing under the input when there is an error.
no setter
hashCode int
The hash code for this object.
no setterinherited
hintText String?
The text appearing inside the input when there is no input
no setter
id → dynamic
Identifier
no setter
infoText String?
When not empty, this will be used as the errorText combined with UI to show the user the message that would otherwise be displayed as an error message when the user. However, when the errorText is visible which could contain that same text, the "error" theme is applied to show seriousness
no setter
inputFormatters List<TextInputFormatter>?
List of TextInputFormatters that can be used to format the text of a TextInput widget
no setter
inputValue String
no setter
isAutoFocused bool
no setter
isDisabled bool
no setter
isHidden bool
no setter
isHighlighted bool
Indicates if the input should be highlighted with a highlight border color
no setter
isInputObscured bool
no setter
isReadOnly bool
If the input should be read-only. This should be treated different from isDisabled which indicates the input has been disabled but the input still looks like a field used for inputs whereas a read-only field does not look like an input at all.
no setter
isSuggestionInput bool
If the input is used as a Suggestion input field
no setter
labelText String?
The text appearing above the input when focused
no setter
maxLength int?
no setter
maxLines int
1 line
no setter
obscuredSuffixIconAsset String?
no setter
obscuringCharacter String
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showCursorOnlyOnFocus bool?
Only show the cursor when the input is focused. If not set, it is up to Flutter's TextFormField to decide.
no setter
showInfoTextWhenFocusedOnly bool
no setter
suffixIconAsset String?
no setter
swapLabelAndHintTextWhenUnfocused bool
By default, Flutter TextFormField shows the labelText in the input input control when the input is not focused and when it doesn't have a value, and show the hintText when the input is focused and the input is empty. This doesn't work when we want to show the hintText when the input is not focused and also does not have a value. In this case, we need to swap the labelText and hintText to achieve this effect by setting swapLabelAndHintTextWhenUnfocused to true
no setter
textCapitalization TextCapitalization?
no setter
textInputAction TextInputAction?
no setter
textInputType TextInputType?
no setter

Methods

map<TResult extends Object?>({required TResult text(TextInputViewModel value), required TResult singleSelect(SingleSelectInputViewModel value), required TResult multipleSelect(MultipleSelectInputViewModel value), required TResult toggledValue(ToggledValueInputViewModel value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? text(TextInputViewModel value)?, TResult? singleSelect(SingleSelectInputViewModel value)?, TResult? multipleSelect(MultipleSelectInputViewModel value)?, TResult? toggledValue(ToggledValueInputViewModel value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult text(TextInputViewModel value)?, TResult singleSelect(SingleSelectInputViewModel value)?, TResult multipleSelect(MultipleSelectInputViewModel value)?, TResult toggledValue(ToggledValueInputViewModel value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult text(dynamic id, String? labelText, String? hintText, String? infoText, bool showInfoTextWhenFocusedOnly, String? errorText, bool swapLabelAndHintTextWhenUnfocused, String inputValue, TextInputAction? textInputAction, TextCapitalization? textCapitalization, String? suffixIconAsset, String? obscuredSuffixIconAsset, bool isInputObscured, String obscuringCharacter, TextInputType? textInputType, bool isReadOnly, bool isHidden, bool isDisabled, bool isHighlighted, bool isSuggestionInput, int maxLines, bool isAutoFocused, bool? showCursorOnlyOnFocus, int? maxLength, AutovalidateMode? autoValidateMode, List<TextInputFormatter>? inputFormatters)?, TResult singleSelect(dynamic id, String? errorText, String? labelText, String? hintText, String? infoText, dynamic value, List<SelectOptionViewModel>? options, bool isHidden, bool isReadOnly, bool isDisabled)?, TResult multipleSelect(dynamic id, String? errorText, String? labelText, String? hintText, List? values, List<SelectOptionViewModel>? options)?, TResult toggledValue(dynamic id, bool value, String label, String? errorText)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult text(dynamic id, String? labelText, String? hintText, String? infoText, bool showInfoTextWhenFocusedOnly, String? errorText, bool swapLabelAndHintTextWhenUnfocused, String inputValue, TextInputAction? textInputAction, TextCapitalization? textCapitalization, String? suffixIconAsset, String? obscuredSuffixIconAsset, bool isInputObscured, String obscuringCharacter, TextInputType? textInputType, bool isReadOnly, bool isHidden, bool isDisabled, bool isHighlighted, bool isSuggestionInput, int maxLines, bool isAutoFocused, bool? showCursorOnlyOnFocus, int? maxLength, AutovalidateMode? autoValidateMode, List<TextInputFormatter>? inputFormatters), required TResult singleSelect(dynamic id, String? errorText, String? labelText, String? hintText, String? infoText, dynamic value, List<SelectOptionViewModel>? options, bool isHidden, bool isReadOnly, bool isDisabled), required TResult multipleSelect(dynamic id, String? errorText, String? labelText, String? hintText, List? values, List<SelectOptionViewModel>? options), required TResult toggledValue(dynamic id, bool value, String label, String? errorText)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? text(dynamic id, String? labelText, String? hintText, String? infoText, bool showInfoTextWhenFocusedOnly, String? errorText, bool swapLabelAndHintTextWhenUnfocused, String inputValue, TextInputAction? textInputAction, TextCapitalization? textCapitalization, String? suffixIconAsset, String? obscuredSuffixIconAsset, bool isInputObscured, String obscuringCharacter, TextInputType? textInputType, bool isReadOnly, bool isHidden, bool isDisabled, bool isHighlighted, bool isSuggestionInput, int maxLines, bool isAutoFocused, bool? showCursorOnlyOnFocus, int? maxLength, AutovalidateMode? autoValidateMode, List<TextInputFormatter>? inputFormatters)?, TResult? singleSelect(dynamic id, String? errorText, String? labelText, String? hintText, String? infoText, dynamic value, List<SelectOptionViewModel>? options, bool isHidden, bool isReadOnly, bool isDisabled)?, TResult? multipleSelect(dynamic id, String? errorText, String? labelText, String? hintText, List? values, List<SelectOptionViewModel>? options)?, TResult? toggledValue(dynamic id, bool value, String label, String? errorText)?}) → TResult?
inherited

Operators

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