FormMapDropdownField<TValue> class

Drop down form to select from there with Map as an option.

Place under the Form that gave FormController.key, or pass FormController to form.

When FormController is passed to form, onSaved must also be passed together. The contents of onSaved will be used to save the data.

Enter the initial value given by FormController.value in initialValue.

Each time the content is changed, onChanged is executed.

If FormController.validate is executed, validation and data saving are performed.

Only when emptyErrorText is specified, emptyErrorText will be displayed as an error if no characters are entered.

Other error checking is performed by specifying validator. If a string other than Null is returned in the callback, the string is displayed as an error statement. If Null is returned, it is processed as no error.

By specifying picker, it is possible to set the selection method for Map.

Deactivated when enabled is set to false.

Mapを選択肢としてそこから選択するためのドロップダウンフォーム。

FormController.keyを与えたForm配下に配置、もしくはformFormControllerを渡します。

formFormControllerを渡した場合、一緒にonSavedも渡してください。データの保存はonSavedの内容が実行されます。

initialValueFormController.valueから与えられた初期値を入力します。

内容が変更される度onChangedが実行されます。

FormController.validateが実行された場合、バリデーションとデータの保存を行ないます。

emptyErrorTextが指定されている時に限り、文字が入力されていない場合emptyErrorTextがエラーとして表示されます。

それ以外のエラーチェックはvalidatorを指定することで行ないます。 コールバック内でNull以外を返すようにするとその文字列がエラー文として表示されます。Nullの場合はエラーなしとして処理されます。

pickerを指定することでMapの選択方法を設定することが可能です。

enabledfalseになると非有効化されます。

Inheritance
Available Extensions

Constructors

FormMapDropdownField({FormController<TValue>? form, Key? key, FormAffixStyle? prefix, FormAffixStyle? suffix, String? hintText, String? labelText, String? emptyErrorText, FormStyle? style, void onChanged(String? value)?, required FormMapDropdownFieldPicker picker, FocusNode? focusNode, bool keepAlive = true, Widget? icon, bool expanded = false, TValue onSaved(String value)?, String validator(String? value)?, String? initialValue, bool enabled = true})
Drop down form to select from there with Map as an option.

Properties

autovalidateMode AutovalidateMode
Used to enable/disable this form field auto validation and update its error text.
finalinherited
builder FormFieldBuilder<String>
Function that returns the widget representing this form field. It is passed the form field state as input, containing the current value and validation state of this field.
finalinherited
emptyErrorText String?
Error text. Only displayed if no characters are entered.
final
enabled bool
Whether the form is able to receive user input.
finalinherited
expanded bool
Extend the form.
final
focusNode FocusNode?
Specifies the focus node.
final
form FormController<TValue>?
Context for forms.
final
hashCode int
The hash code for this object.
no setterinherited
hintText String?
Hint to be displayed on the form. Displayed when no text is entered.
final
icon Widget?
Specify the icon displayed on the right side of the drop-down form.
final
initialValue String?
An optional value to initialize the form field to, or null otherwise.
finalinherited
keepAlive bool
If placed in a list, whether or not it should not be discarded on scrolling.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelText String?
Label text for forms.
final
onChanged → (void Function(String? value)?)
Callback to be executed each time the value is changed.
final
onSaved FormFieldSetter<String>?
An optional method to call with the final value when the form is saved via FormState.save.
finalinherited
picker FormMapDropdownFieldPicker
Picker object for selecting from Map.
final
prefix FormAffixStyle?
A widget that is placed in front of the form.
final
restorationId String?
Restoration ID to save and restore the state of the form field.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style FormStyle?
Form Style.
final
suffix FormAffixStyle?
A widget that is placed after the form.
final
validator FormFieldValidator<String>?
An optional method that validates an input. Returns an error string to display if the input is invalid, or null otherwise.
finalinherited

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() FormFieldState<String>
Creates the mutable state for this widget at a given location in the tree.
override
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