FormRef class

A reference scoped to the form passed from FormScopedWidget.build.

RefHasApp, RefHasPage and RefHasWidget are implemented to manage state for the scopes app, page and widget.

It is also possible to obtain the data ID of the currently editing form at editId by placing FormEditPageScopedWidget or FormAddPageScopedWidget in the parent.

Then, if editId is Null, isAdding will be true, otherwise isEditing will be true.

FormScopedWidget.buildから渡されるフォームにスコープしたリファレンス。

RefHasAppRefHasPageRefHasWidgetを実装しておりapppagewidgetのスコープに対して状態を管理できます。

また、FormEditPageScopedWidgetFormAddPageScopedWidgetを親に配置することによりeditIdで現在フォームを編集中のデータIDを取得することが可能です。

そのとき、editIdNullの場合、isAddingtrueになり、それ以外の場合はisEditingtrueになります。

Implemented types
Available Extensions
Annotations

Properties

app AppScopedValueRef
Ref in the application scope.
no setteroverride
editId String?
Data ID currently being edited.
final
hashCode int
The hash code for this object.
no setterinherited
isAdding bool
True` is returned for new additions.
no setter
isEditing bool
True` is returned if existing data is being edited.
no setter
page PageScopedValueRef
Ref in the page scope.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
widget WidgetScopedValueRef
Ref in the widget scope.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
select<T>({required T onAdd(), required T onEdit(String editId)}) → T
When a value is being added to a form, onAdd is executed; when editing, onEdit is executed.
toString() String
A string representation of this object.
inherited

Operators

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