FocusQuestNotifier class
Riverpod notifier that coordinates a FocusQuestController.
Constructors
Properties
- controller ↔ FocusQuestController
-
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
- ref → Ref
-
The
Refassociated with this notifier.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state ↔ FocusQuestState
-
The value currently exposed by this notifier.
getter/setter pairinherited
- stateOrNull → FocusQuestState?
-
The value currently exposed by this
Notifier.no setterinherited
Methods
-
build(
) → FocusQuestState -
Initialize a
Notifier. -
cancel(
{String? reason}) → Future< void> - Cancels the active session with an optional reason.
-
clearError(
) → Future< void> - Clears the current error value.
-
complete(
) → Future< void> - Completes the active session and applies rewards.
-
initialize(
) → Future< void> - Initializes storage, restores sessions, and refreshes state.
-
listenSelf(
void listener(FocusQuestState? previous, FocusQuestState next), {void onError(Object error, StackTrace stackTrace)?}) → RemoveListener -
Listens to changes on the value exposed by this provider.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
) → Future< void> - Pauses the active running session.
-
refreshStatistics(
) → Future< void> - Recomputes statistics from the current controller state.
-
reset(
) → Future< void> - Resets the active session state.
-
resume(
) → Future< void> - Resumes the active paused session.
-
runBuild(
) → WhenComplete? -
Executes
Notifier.build.inherited -
start(
{Duration? duration, Map< String, Object?> ? metadata}) → Future<void> - Starts a new focus session.
-
toString(
) → String -
A string representation of this object.
inherited
-
updateShouldNotify(
FocusQuestState previous, FocusQuestState next) → bool -
A method invoked when the state exposed by this
Notifierchanges. It compares the previous and new value, and return whether listeners should be notified.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited