showSubZeroOnboardingDialog function

Future<bool> showSubZeroOnboardingDialog({
  1. required BuildContext context,
  2. required List<SubZeroOnboardingStep> steps,
  3. String? badgeLabel,
  4. VoidCallback? onComplete,
  5. VoidCallback? onSkip,
  6. 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;
}