diff --git a/lib/constants.dart b/lib/constants.dart index f07d43f7..2551a474 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -5,6 +5,7 @@ class LoonoAssets { static const ppfLogo = 'assets/sponsors/ppf.svg'; static const cgiLogo = 'assets/sponsors/CGI.svg'; static const mzcrLogo = 'assets/sponsors/mzcr.svg'; + static const welcomeLogo = 'assets/icons/welcome-logo.svg'; static const customExamBadge = 'assets/badges_examination/custom_examination/badge'; static const examinationCardSuccessIcon = 'assets/icons/prevention/success_checkmark.svg'; @@ -12,7 +13,6 @@ class LoonoAssets { static const calendarIcon = 'assets/icons/prevention/calendar.svg'; static const ellipse = 'assets/icons/ellipse.svg'; - static const welcomeLogo = 'assets/icons/welcome-logo.svg'; static const genderFemale = 'assets/icons/gender-woman.svg'; static const genderMale = 'assets/icons/gender-man.svg'; diff --git a/lib/ui/screens/onboarding/badge_overview.dart b/lib/ui/screens/onboarding/badge_overview.dart index f77687e0..7be6502e 100644 --- a/lib/ui/screens/onboarding/badge_overview.dart +++ b/lib/ui/screens/onboarding/badge_overview.dart @@ -28,128 +28,100 @@ class BadgeOverviewScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return WillPopScope( - onWillPop: () async => false, - child: Scaffold( - body: SafeArea( - child: Padding( - padding: const EdgeInsets.only(top: 18), - child: StreamBuilder( - stream: _usersDao.watchUser(), - builder: (context, snapshot) { - final user = snapshot.data; - final sex = user?.sex; + return Scaffold( + body: SafeArea( + child: Padding( + padding: const EdgeInsets.only(top: 18), + child: StreamBuilder( + stream: _usersDao.watchUser(), + builder: (context, snapshot) { + final user = snapshot.data; + final sex = user?.sex; - return Stack( - children: [ - Padding( - padding: EdgeInsets.only( - left: context.mediaQuery.compactSizeOf(24.0), - top: context.mediaQuery.compactSizeOf(100), + return Stack( + children: [ + Padding( + padding: EdgeInsets.only( + left: context.mediaQuery.compactSizeOf(24.0), + top: context.mediaQuery.compactSizeOf(100), + ), + child: SvgPicture.asset( + LoonoAssets.heroBackground, + width: double.infinity, + height: context.mediaQuery.size.width * 0.735, + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const CustomSpacer.vertical(24), + Text( + '${sex == Sex.MALE ? context.l10n.gamification_introduction_header_male : context.l10n.gamification_introduction_header_female} ${user?.nickname ?? (sex?.getNicknameHintLabel(context)) ?? ''}', + textAlign: TextAlign.center, + style: LoonoFonts.headerFontStyle, ), - child: SvgPicture.asset( - LoonoAssets.heroBackground, - width: double.infinity, - height: context.mediaQuery.size.width * 0.735, + const CustomSpacer.vertical(18), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const LoonoPointIcon(color: LoonoColors.primaryEnabled, width: 16.0), + const CustomSpacer.horizontal(7), + Text( + '${user?.points ?? 0} ${context.l10n.gamification_introduction_points.toUpperCase()}', + style: LoonoFonts.subtitleFontStyle.copyWith( + color: LoonoColors.primaryEnabled, + fontSize: 11, + ), + ), + ], ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - const CustomSpacer.vertical(24), - Text( - '${sex == Sex.MALE ? context.l10n.gamification_introduction_header_male : context.l10n.gamification_introduction_header_female} ${user?.nickname ?? (sex?.getNicknameHintLabel(context)) ?? ''}', - textAlign: TextAlign.center, - style: LoonoFonts.headerFontStyle, - ), - const CustomSpacer.vertical(18), - Row( - mainAxisAlignment: MainAxisAlignment.center, + Expanded( + child: Stack( children: [ - const LoonoPointIcon(color: LoonoColors.primaryEnabled, width: 16.0), - const CustomSpacer.horizontal(7), - Text( - '${user?.points ?? 0} ${context.l10n.gamification_introduction_points.toUpperCase()}', - style: LoonoFonts.subtitleFontStyle.copyWith( - color: LoonoColors.primaryEnabled, - fontSize: 11, + Scrollbar( + thumbVisibility: true, + child: ListView( + shrinkWrap: true, + children: [ + const BadgeComposer(), + const CustomSpacer.vertical(10), + Padding( + padding: EdgeInsets.symmetric( + horizontal: context.mediaQuery.compactSizeOf(18), + ), + child: _buildDescContainer(context), + ), + SizedBox(height: LoonoSizes.buttonBottomPadding(context)), + SizedBox(height: LoonoSizes.buttonBottomPadding(context)), + ], ), ), - ], - ), - if (LoonoSizes.isScreenSmall(context)) - Expanded( - child: Stack( - children: [ - Scrollbar( - thumbVisibility: true, - child: ListView( - shrinkWrap: true, - children: [ - const BadgeComposer(), - const CustomSpacer.vertical(10), - Padding( - padding: EdgeInsets.symmetric( - horizontal: context.mediaQuery.compactSizeOf(18), - ), - child: _buildDescContainer(context), - ), - SizedBox(height: LoonoSizes.buttonBottomPadding(context)), - SizedBox(height: LoonoSizes.buttonBottomPadding(context)), - ], + Positioned( + bottom: 10, + child: SizedBox( + width: MediaQuery.of(context).size.width, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: context.mediaQuery.compactSizeOf(18), ), - ), - Positioned( - bottom: 10, - child: SizedBox( - width: MediaQuery.of(context).size.width, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: context.mediaQuery.compactSizeOf(18), - ), - child: LoonoButton( - key: const Key('badgeOverviewPage_btn_continue'), - text: context.l10n.gamification_introduction_button, - onTap: onButtonTap ?? - () => AutoRouter.of(context) - .replaceAll([const MainScreenRouter()]), - ), - ), + child: LoonoButton( + key: const Key('badgeOverviewPage_btn_continue'), + text: context.l10n.gamification_introduction_button, + onTap: onButtonTap ?? + () => AutoRouter.of(context) + .replaceAll([const MainScreenRouter()]), ), ), - ], - ), - ) - else ...[ - const BadgeComposer(), - const SizedBox(height: 10), - Padding( - padding: EdgeInsets.symmetric( - horizontal: context.mediaQuery.compactSizeOf(18), - ), - child: _buildDescContainer(context), - ), - const Spacer(), - Padding( - padding: EdgeInsets.symmetric( - horizontal: context.mediaQuery.compactSizeOf(18), - ), - child: LoonoButton( - key: const Key('badgeOverviewPage_btn_continue'), - text: context.l10n.gamification_introduction_button, - onTap: onButtonTap ?? - () => - AutoRouter.of(context).replaceAll([const MainScreenRouter()]), + ), ), - ), - const Spacer(flex: 2), - ], - ], - ), - ], - ); - }, - ), + ], + ), + ), + ], + ), + ], + ); + }, ), ), ),