showSubZeroOnboardingDialog function
Future<bool>
showSubZeroOnboardingDialog({
- required BuildContext context,
- required List<
SubZeroOnboardingStep> steps, - String? badgeLabel,
- VoidCallback? onComplete,
- VoidCallback? onSkip,
- bool barrierDismissible = false,
Shows a multi-step onboarding dialog.
Example usage:
await showSubZeroOnboardingDialog(
context: context,
badgeLabel: 'Quick tip',
steps: [
SubZeroOnboardingStep(
title: 'New feature',
description: 'Something about this feature and what it does.',
),
SubZeroOnboardingStep(
title: 'Another feature',
description: 'More information here.',
),
],
onComplete: () => print('Completed!'),
onSkip: () => print('Skipped!'),
);
Implementation
Future<bool> showSubZeroOnboardingDialog({
required BuildContext context,
required List<SubZeroOnboardingStep> steps,
String? badgeLabel,
VoidCallback? onComplete,
VoidCallback? onSkip,
bool barrierDismissible = false,
}) async {
final result = await showDialog<bool>(
context: context,
barrierDismissible: barrierDismissible,
barrierColor: Colors.black.withValues(alpha: 0.5),
builder: (context) => _SubZeroOnboardingDialog(
steps: steps,
badgeLabel: badgeLabel,
onComplete: onComplete,
onSkip: onSkip,
),
);
return result ?? false;
}