Skip to content

Commit

Permalink
Fix last test
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-costas committed Nov 8, 2023
1 parent 023e766 commit 944d82e
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions packages/ubuntu_init/lib/src/init_wizard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ class InitWizard extends ConsumerWidget {
builder: (_) => const PrivacyPage(),
onLoad: (_) => PrivacyPage.load(ref),
),
InitRoutes.store: () {
bool shownPage = false;
return WizardRoute(
userData: const WizardRouteData(hasNext: false),
builder: (_) => const StorePage(),
onLoad: (_) {
shownPage = true;
return StorePage.load(ref);
},
onNext: (_) async {
if (shownPage) {
final window = YaruWindow.of(context);
await _onDone?.call();
await window.close();
return InitRoutes.initial;
} else {
return null;
}
},
);
}(),
InitRoutes.launchsession: () {
bool shownPage = false;
return WizardRoute(
Expand All @@ -136,17 +157,6 @@ class InitWizard extends ConsumerWidget {
}
});
}(),
InitRoutes.store: WizardRoute(
userData: const WizardRouteData(hasNext: false),
builder: (_) => const StorePage(),
onLoad: (_) => StorePage.load(ref),
onNext: (_) async {
final window = YaruWindow.of(context);
await _onDone?.call();
await window.close();
return InitRoutes.initial;
},
),
},
userData: WizardData(totalSteps: InitStep.values.length),
predicate: (route) => switch (route) {
Expand Down

0 comments on commit 944d82e

Please sign in to comment.