Skip to content

Commit

Permalink
feat(#670): add own setting for drug selection
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Dec 1, 2023
1 parent 63bc4db commit 110408c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion app/lib/login/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ class LoginPage extends HookWidget {

Widget _buildLoadedScreen(BuildContext context) {
return _buildColumnWrapper(
action: () => context.router.replace(OnboardingRouter()),
action: () => context.router.replace(
OnboardingRouter(nextPage: DrugSelectionRouter())
),
actionText: context.l10n.general_continue,
children: [
Icon(
Expand Down
6 changes: 5 additions & 1 deletion app/lib/onboarding/pages/onboarding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import '../../../common/module.dart' hide MetaData;

class OnboardingPage extends HookWidget {
OnboardingPage({ required this.nextPage });

final PageRouteInfo<dynamic> nextPage;

final _pages = [
OnboardingSubPage(
illustrationPath: 'assets/images/onboarding/1.png',
Expand Down Expand Up @@ -163,7 +167,7 @@ class OnboardingPage extends HookWidget {
if (isLastPage) {
// Replace whole stack, see https://stackoverflow.com/a/73784156
context.router.pushAndPopUntil(
DrugSelectionRouter(),
nextPage,
predicate: (_) => false
);
} else {
Expand Down
7 changes: 6 additions & 1 deletion app/lib/settings/pages/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class SettingsPage extends StatelessWidget {
),
dense: true,
),
ListTile(
title: Text(context.l10n.drug_selection_header),
trailing: Icon(Icons.chevron_right_rounded),
onTap: () => context.router.push(DrugSelectionRouter()),
),
ListTile(
title: Text(context.l10n.settings_page_delete_data),
trailing: Icon(Icons.chevron_right_rounded),
Expand All @@ -33,7 +38,7 @@ class SettingsPage extends StatelessWidget {
ListTile(
title: Text(context.l10n.settings_page_onboarding),
trailing: Icon(Icons.chevron_right_rounded),
onTap: () => context.router.push(OnboardingRouter()),
onTap: () => context.router.push(OnboardingRouter(nextPage: MainRoute())),
),
ListTile(
title: Text(context.l10n.settings_page_about_us),
Expand Down

0 comments on commit 110408c

Please sign in to comment.