getPageWidget method

Widget getPageWidget(
  1. BuildContext context
)

Implementation

Widget getPageWidget(BuildContext context) {
  final LocalDatabase localDatabase = context.read<LocalDatabase>();
  final Color backgroundColor = getBackgroundColor();
  switch (this) {
    case OnboardingPage.NOT_STARTED:
    case OnboardingPage.HOME_PAGE:
      return const OnboardingHomePage();
    case OnboardingPage.WELCOME:
      return WelcomePage(backgroundColor);
    case OnboardingPage.HEALTH_CARD_EXAMPLE:
      return _wrapWidgetInCustomBackNavigator(
        context,
        SampleHealthCardPage(localDatabase, backgroundColor),
      );
    case OnboardingPage.ECO_CARD_EXAMPLE:
      return _wrapWidgetInCustomBackNavigator(
        context,
        SampleEcoCardPage(localDatabase, backgroundColor),
      );
    case OnboardingPage.PREFERENCES_PAGE:
      return _wrapWidgetInCustomBackNavigator(
        context,
        PreferencesPage(localDatabase, backgroundColor),
      );
    case OnboardingPage.PERMISSIONS_PAGE:
      return _wrapWidgetInCustomBackNavigator(
        context,
        PermissionsPage(backgroundColor),
      );
    case OnboardingPage.ONBOARDING_COMPLETE:
      return ExternalScanCarouselManager(child: PageManager());
  }
}