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から渡されるフォームにスコープしたリファレンス。
RefHasAppとRefHasPage、RefHasWidgetを実装しておりappとpage、widgetのスコープに対して状態を管理できます。
また、FormEditPageScopedWidgetやFormAddPageScopedWidgetを親に配置することによりeditIdで現在フォームを編集中のデータIDを取得することが可能です。
そのとき、editIdがNullの場合、isAddingがtrue
になり、それ以外の場合はisEditingがtrue
になります。
- Implemented types
- Available Extensions
- FutureIndicatorExtensions
- MasamuneChangeNotifierScopedValueRefExtensions
- MasamuneControllerRefHasAppExtensions
- MasamuneFormRefHasPageExtensions
- MasamuneModelRefHasAppExtensions
- MasamuneRouterRefHasPageExtensions
- RefHasAppQueryExtensions
- RefHasPageCacheExtensions
- RefHasPageFetchExtensions
- RefHasPageFutureExtensions
- RefHasPageOnExtensions
- RefHasPagePeriodicExtensions
- RefHasPageRefreshExtensions
- RefHasPageScheduleExtensions
- RefHasPageTimerExtensions
- RefHasPageWatchExtensions
- 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