Skip to content

Commit

Permalink
Revert "feat(#578): remove onboarding"
Browse files Browse the repository at this point in the history
This reverts commit d3c9975.
  • Loading branch information
tamslo committed Apr 18, 2023
1 parent 22cde6e commit 5e6e1f7
Show file tree
Hide file tree
Showing 18 changed files with 3,539 additions and 1 deletion.
Binary file added app/assets/images/onboarding/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/onboarding/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/onboarding/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/onboarding/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/onboarding/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
594 changes: 594 additions & 0 deletions app/assets/images/onboarding/svg/2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,332 changes: 1,332 additions & 0 deletions app/assets/images/onboarding/svg/3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
466 changes: 466 additions & 0 deletions app/assets/images/onboarding/svg/4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
725 changes: 725 additions & 0 deletions app/assets/images/onboarding/svg/5.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions app/integration_test/onboarding_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import 'package:app/common/module.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';

void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();

binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.onlyPumps;

group('integration tests for the onboarding', () {
testWidgets('Test that pages are changing', (tester) async {
final appRouter = AppRouter();
await tester.pumpWidget(MaterialApp.router(
debugShowCheckedModeBanner: false,
routeInformationParser: appRouter.defaultRouteParser(),
routerDelegate: appRouter.delegate(
initialDeepLink: 'onboarding',
),
localizationsDelegates: [
AppLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: [Locale('en', '')],
));

await tester.pumpAndSettle();

final BuildContext context = tester.element(find.byType(Scaffold).first);
expect(find.text(context.l10n.onboarding_1_header), findsOneWidget);

// change page
await tester.tap(find.byKey(ValueKey('nextButton')));
await tester.pumpAndSettle();
expect(find.text(context.l10n.onboarding_2_header), findsOneWidget);
// change page
await tester.tap(find.byKey(ValueKey('nextButton')));
await tester.pumpAndSettle();
expect(find.text(context.l10n.onboarding_3_header), findsOneWidget);

await tester.tap(find.byKey(ValueKey('nextButton')));
await tester.pumpAndSettle();
expect(find.text(context.l10n.onboarding_4_header), findsOneWidget);

await tester.tap(find.byKey(ValueKey('nextButton')));
await tester.pumpAndSettle();
expect(find.text(context.l10n.onboarding_5_header), findsOneWidget);
});
});
}
9 changes: 9 additions & 0 deletions app/integration_test/settings_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ void main() {
await tester.tap(find.text(context.l10n.action_cancel));
await tester.pumpAndSettle();

// test onboarding button
await tester.tap(find.text(context.l10n.settings_page_onboarding));
await tester.pumpAndSettle();

expect(find.text(context.l10n.onboarding_1_header), findsOneWidget);

await context.router.root.pop();
await tester.pumpAndSettle();

// test about us
await tester.tap(find.text(context.l10n.settings_page_about_us));
await tester.pumpAndSettle();
Expand Down
2 changes: 2 additions & 0 deletions app/lib/common/routing/router.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../../common/module.dart';
import '../../faq/module.dart';
import '../../login/module.dart';
import '../../onboarding/module.dart';
import '../../report/module.dart';
import '../../search/module.dart';
import '../../settings/module.dart';
Expand All @@ -12,6 +13,7 @@ part 'router.gr.dart';
replaceInRouteName: 'Page,Route',
routes: [
loginRoutes,
onboardingRoutes,
AutoRoute(
path: 'main',
page: MainPage,
Expand Down
2 changes: 1 addition & 1 deletion app/lib/common/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PharMeApp extends StatelessWidget {
debugShowCheckedModeBanner: false,
routeInformationParser: _appRouter.defaultRouteParser(),
routerDelegate: _appRouter.delegate(
initialDeepLink: _isLoggedIn ? 'main' : 'login',
initialDeepLink: _isLoggedIn ? 'main' : 'onboarding',
),
theme: PharMeTheme.light,
localizationsDelegates: [
Expand Down
17 changes: 17 additions & 0 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,27 @@
"nav_more": "More",
"tab_more": "More",

"onboarding_get_started": "Get started",
"onboarding_next": "Next",
"onboarding_prev": "Back",
"onboarding_1_header": "Welcome to PharMe",
"onboarding_1_text": "Your genome has more influence on your life than you might think!\nMore than 90% of people are vulnerable to unintended drug reactions.\n\nUse PharMe to find out about yours.",
"onboarding_2_header": "One size does not fit all",
"onboarding_2_text": "Your body reacts to drugs uniquely.\n\nDrugs that are effective for a majority of people can be toxic to you.",
"onboarding_3_header": "Genome power unlocked to improve human health",
"onboarding_3_text": "PharMe warns about unintended drug responses according to your genome.\nThis enables you to avoid drugs that are ineffective or have side-effects.",
"onboarding_3_disclaimer": "We DO NOT recommend drugs for specific symptoms or illnesses!",
"onboarding_4_header": "Tailored to your genome",
"onboarding_4_text": "For PharMe to work, you need to get your genetics tested at a lab. You don't need an account to use PharMe: You can just sign in to the lab's website through our app.",
"onboarding_4_button": "Find out more about gene tests here.",
"onboarding_5_header": "We care about your data protection",
"onboarding_5_text": "After signing in to the lab, your genetic data is sent straight onto your phone.\n\nOur servers know nothing about you, neither your identity nor your genetics.",

"settings_page_account_settings": "Account Settings",
"settings_page_delete_data": "Delete App Data",
"settings_page_delete_data_text": "Are you sure that you want to delete all app data? This also includes your genomic data.",
"settings_page_more": "More",
"settings_page_onboarding": "Onboarding",
"settings_page_about_us": "About us",
"settings_page_about_us_text": "PharMe was created as a bachelors project at Hasso-Plattner-Institut (HPI) Potsdam. The aim of the project is to provide a proof of concept for digital health apps that use pharmacogenomic information for health improvements. We collaborate with the Digital Health chair at HPI and health professionals from Mount Sinai hospital in New York.",
"settings_page_privacy_policy": "Privacy policy",
Expand Down
10 changes: 10 additions & 0 deletions app/lib/onboarding/module.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import '../common/module.dart';
import 'pages/onboarding.dart';

export 'pages/onboarding.dart';

const onboardingRoutes = AutoRoute(
path: 'onboarding',
name: 'OnboardingRouter',
page: OnboardingPage,
);
Loading

0 comments on commit 5e6e1f7

Please sign in to comment.