Skip to content

Commit

Permalink
Fix/pri zvetseni pisma apk nefunguje spravne#120 (#469)
Browse files Browse the repository at this point in the history
* fix/pri_zvetseni_pisma_apk_nefunguje_spravne (Loono-cz/loono-tasks#120)
oprava zobrazování WelcomeScreen

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne (Loono-cz/loono-tasks#120)
oprava zobrazování carousel_second

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne
add space.dart widget
big font size optimalization

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne (Loono-cz/loono-tasks#120)

* fix analyze

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne (#449)

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne
format, pub get

* fix format

* fix tests

* move color to constants

* fix/pri_zvetseni_pisma_apk_nefunguje_spravne

* format

Co-authored-by: Jakub Smolik <[email protected]>
  • Loading branch information
Brambora0 and smolikjacgi authored Dec 14, 2022
1 parent 4974fe3 commit cdb26f9
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 113 deletions.
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ 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';

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';
Expand Down
196 changes: 84 additions & 112 deletions lib/ui/screens/onboarding/badge_overview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<User?>(
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<User?>(
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),
],
],
),
],
);
},
),
],
),
),
],
),
],
);
},
),
),
),
Expand Down

0 comments on commit cdb26f9

Please sign in to comment.