FormMapModalField<TValue> class
Form to select from there with Map as an option.
A form field specialized for inputting Key-Value pair Map type data.
Common design can be applied with FormStyle, and map data input and management can be performed using FormController.
It provides features such as custom design.
Key-ValueペアのMap型のデータ入力に特化したフォームフィールド。
FormStyleで共通したデザインを適用可能。またFormControllerを利用してマップデータの入力と管理を行うことができます。
カスタムデザインなどの機能を備えています。
Basic Usage Example 基本的な使用例
final countries = <String, String>{
"ja": "日本語",
"en": "English",
"es": "Español",
"fr": "Français",
};
FormMapModalField(
form: formController,
initialValue: formController.value.selectedLanguage,
onSaved: (value) => formController.value.copyWith(selectedLanguage: value),
picker: FormMapModalFieldPicker(
values: countries,
),
);
Usage Example with Validation バリデーション付きの使用例
FormMapModalField(
form: formController,
initialValue: formController.value.selectedLanguage,
onSaved: (value) => formController.value.copyWith(selectedLanguage: value),
validator: (value) {
if (value == null) {
return "地域を選択してください";
}
return null;
},
picker: FormMapModalFieldPicker(
values: countries,
),
);
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- FormMapModalField
Constructors
-
FormMapModalField({required FormMapModalFieldPicker picker, FormController<
TValue> ? form, Key? key, TextEditingController? controller, FormAffixStyle? prefix, FormAffixStyle? suffix, String? hintText, String? labelText, FormStyle? style, bool enabled = true, bool readOnly = false, FormFieldValidator<String?> ? validator, void onChanged(String? value)?, String? initialValue, TValue onSaved(String value)?, FocusNode? focusNode, String? emptyErrorText, void onSubmitted(String? value)?, bool keepAlive = true, bool showDropdownIcon = true, Widget? dropdownIcon}) -
Form to select from there with Map as an option.
const
Properties
- controller → TextEditingController?
-
Controller for text forms.
final
- dropdownIcon → Widget?
-
Icon for dropdown. Valid only if showDropdownIcon is
true.final - emptyErrorText → String?
-
Error text. Only displayed if no characters are entered.
final
- enabled → bool
-
If this is
false, it is deactivated.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
- initialValue → String?
-
Initial value.
final
- 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 → TValue Function(String value)?
-
Callback executed when FormController.validate is executed.
final
- onSubmitted → void Function(String? value)?
-
It is executed when the Enter button on the keyboard or the Submit button on the software keyboard is pressed.
final
- picker → FormMapModalFieldPicker
-
Picker object for selecting from Map.
final
- prefix → FormAffixStyle?
-
A widget that is placed in front of the form.
final
- readOnly → bool
-
If this is
true, the form cannot be filled out and changed from its initial value.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showDropdownIcon → bool
-
true` if you want to display icons for drop-downs.
final
- style → FormStyle?
-
Form Style.
final
- suffix → FormAffixStyle?
-
A widget that is placed after the form.
final
- validator → String? Function(String? value)?
-
Validator to be executed when FormController.validate is executed.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
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, int wrapWidth = 65}) → 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