FormDurationField<TValue> class

Form to have the duration selected.

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.

The onSubmitted process is executed when the Enter key or other keys are pressed.

The interval selection method can be set by specifying picker.

If enabled is false, the text is deactivated.

If readOnly is set to true, the activation is displayed, but the text cannot be changed.

デュレーションを選択させるためのフォーム。

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

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

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

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

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

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

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

Enterキーなどが押された場合の処理をonSubmittedが実行されます。

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

enabledfalseになるとテキストが非有効化されます。

readOnlytrueになっている場合は、有効化の表示になりますが、テキストが変更できなくなります。

Inheritance
Available Extensions

Constructors

FormDurationField({FormController<TValue>? form, Key? key, TextEditingController? controller, FormAffixStyle? prefix, FormAffixStyle? suffix, FocusNode? focusNode, TextInputType keyboardType = TextInputType.text, String? hintText, String? labelText, FormStyle? style, bool enabled = true, String? emptyErrorText, bool readOnly = false, FormFieldValidator<Duration?>? validator, void onChanged(Duration? value)?, void onSubmitted(Duration? value)?, Duration? initialValue, String? format, FormDurationFieldPicker picker = const FormDurationFieldPicker(), TValue onSaved(Duration value)?, bool keepAlive = true, bool showDropdownIcon = true, Widget? dropdownIcon})
Form to have the duration selected.
const

Properties

controller TextEditingController?
Controller for text forms.
final
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
format String
Formatter for formatting Duration to String.
no setter
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 Duration?
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
keyboardType TextInputType
Mobile software keyboard type.
final
labelText String?
Label text for forms.
final
onChanged → (void Function(Duration? value)?)
Callback to be executed each time the value is changed.
final
onSaved → (TValue Function(Duration value)?)
Callback executed when FormController.validate is executed.
final
onSubmitted → (void Function(Duration? value)?)
It is executed when the Enter button on the keyboard or the Submit button on the software keyboard is pressed.
final
picker FormDurationFieldPicker
Picker object for selecting intervals.
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 FormFieldValidator<Duration?>?
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}) 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