SubZeroOnboardingService class
A service that manages onboarding and coachmark display logic with persistence.
Use this service to:
- Track which onboarding flows have been completed
- Ensure onboarding is only shown once per version/feature
- Reset onboarding state for testing or new app versions
Example usage:
final service = SubZeroOnboardingService();
await service.init();
if (!await service.hasCompleted('welcome_tour_v1')) {
// Show onboarding
await service.markCompleted('welcome_tour_v1');
}
Constructors
- SubZeroOnboardingService()
-
factory
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
-
hasCompleted(
String onboardingId) → Future< bool> - Check if a specific onboarding flow has been completed.
-
init(
) → Future< void> - Initialize the service. Must be called before using other methods.
-
markCompleted(
String onboardingId) → Future< void> - Mark a specific onboarding flow as completed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
String onboardingId) → Future< void> - Reset a specific onboarding flow (show again).
-
resetAll(
) → Future< void> - Reset all onboarding states (useful for testing or new app versions).
-
showIfNotCompleted(
{required String onboardingId, required Future< void> showOnboarding()}) → Future<bool> - Check and show onboarding if not completed. Returns true if onboarding was shown, false if already completed.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited