CreateActivity class CreateActivity
This provider exposes an ActivityModel for creating or editing an activity.
If the user is editing an activity, the original data is set using the update
method. Otherwise, a new ActivityModel is created. When setting data to update,
the isEdited property is set to true. This is used to determine if the
activity should be created or edited.
- Annotations
-
- @Riverpod(keepAlive: true)
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
build(
) → ActivityModel -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
saveActivity(
) → Future< CreateActivityResult> - Save the activity to Firestore. If the user is editing an activity, the activity is updated. Otherwise, a new activity is created.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
ActivityModel cb(ActivityModel state)) → void - Update the activity model with the provided callback function.
-
uploadBannerIfNeeded(
) → Future< void> - If the user sets a banner image, upload it to Firebase Storage. This is done when the user submits the form. If the user is editing an activity and the banner is already uploaded, this function does nothing.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited