From 72a54cfb74439986c0d721857b18d511698f758d Mon Sep 17 00:00:00 2001 From: Pierre Slamich Date: Tue, 7 Jan 2025 15:19:04 +0100 Subject: [PATCH] feat: Create guide_nutriscore.dart --- .../pages/guides/guide/guide_nutriscore.dart | 213 ++++++++++++++++++ 1 file changed, 213 insertions(+) create mode 100644 packages/smooth_app/lib/pages/guides/guide/guide_nutriscore.dart diff --git a/packages/smooth_app/lib/pages/guides/guide/guide_nutriscore.dart b/packages/smooth_app/lib/pages/guides/guide/guide_nutriscore.dart new file mode 100644 index 000000000000..098f2a70d342 --- /dev/null +++ b/packages/smooth_app/lib/pages/guides/guide/guide_nutriscore.dart @@ -0,0 +1,213 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:smooth_app/pages/guides/helpers/guides_content.dart'; +import 'package:smooth_app/pages/guides/helpers/guides_footer.dart'; +import 'package:smooth_app/pages/guides/helpers/guides_header.dart'; +import 'package:smooth_app/resources/app_icons.dart'; + +class GuideNutriscoreV2 extends StatelessWidget { + const GuideNutriscoreV2({super.key}); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesPage( + pageName: 'NutriscoreV2', + header: const _NutriscoreHeader(), + body: const [ + _NutriScoreSection1(), + _NutriScoreSection2(), + _NutriScoreSection3(), + _NutriScoreSection4(), + _NutriScoreSection5(), + ], + footer: SliverToBoxAdapter( + child: GuidesFooter( + shareMessage: appLocalizations.guide_nutriscore_v2_share_message, + shareUrl: appLocalizations.guide_nutriscore_v2_share_link, + ), + ), + ); + } +} + +class _NutriscoreHeader extends StatelessWidget { + const _NutriscoreHeader(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesHeader( + title: appLocalizations.guide_nutriscore_v2_title, + illustration: const _NutriScoreHeaderIllustration(), + ); + } +} + +class _NutriScoreHeaderIllustration extends StatelessWidget { + const _NutriScoreHeaderIllustration(); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Expanded( + flex: 32, + child: SvgPicture.asset('assets/cache/nutriscore-a.svg'), + ), + const Expanded( + flex: 28, + child: Arrow.down( + color: Colors.white, + ), + ), + Expanded( + flex: 40, + child: SvgPicture.asset( + 'assets/cache/nutriscore-a-new-${AppLocalizations.of(context).guide_nutriscore_v2_file_language}.svg'), + ), + ], + ); + } +} + +class _NutriScoreSection1 extends StatelessWidget { + const _NutriScoreSection1(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesParagraph( + title: appLocalizations.guide_nutriscore_v2_what_is_nutriscore_title, + content: [ + GuidesText( + text: appLocalizations + .guide_nutriscore_v2_what_is_nutriscore_paragraph1, + ), + GuidesText( + text: appLocalizations + .guide_nutriscore_v2_what_is_nutriscore_paragraph2, + ), + GuidesImage( + imagePath: 'assets/cache/nutriscore-a.svg', + caption: appLocalizations.guide_nutriscore_v2_nutriscore_a_caption, + desiredWidthPercent: 0.30, + ), + ], + ); + } +} + +class _NutriScoreSection2 extends StatelessWidget { + const _NutriScoreSection2(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesParagraph( + title: appLocalizations.guide_nutriscore_v2_why_v2_title, + content: [ + GuidesText( + text: appLocalizations.guide_nutriscore_v2_why_v2_intro, + ), + GuidesTitleWithText( + title: appLocalizations.guide_nutriscore_v2_why_v2_arg1_title, + icon: const Milk(), + text: appLocalizations.guide_nutriscore_v2_why_v2_arg1_text, + ), + GuidesTitleWithText( + title: appLocalizations.guide_nutriscore_v2_why_v2_arg2_title, + icon: const Soda.unhappy(), + text: appLocalizations.guide_nutriscore_v2_why_v2_arg2_text, + ), + GuidesTitleWithText( + title: appLocalizations.guide_nutriscore_v2_why_v2_arg3_title, + icon: const Salt(), + text: appLocalizations.guide_nutriscore_v2_why_v2_arg3_text, + ), + GuidesTitleWithText( + title: appLocalizations.guide_nutriscore_v2_why_v2_arg4_title, + icon: const Fish(), + text: appLocalizations.guide_nutriscore_v2_why_v2_arg4_text, + ), + GuidesTitleWithText( + title: appLocalizations.guide_nutriscore_v2_why_v2_arg5_title, + icon: const Chicken(), + text: appLocalizations.guide_nutriscore_v2_why_v2_arg5_text, + ), + ], + ); + } +} + +class _NutriScoreSection3 extends StatelessWidget { + const _NutriScoreSection3(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesParagraph( + title: appLocalizations.guide_nutriscore_v2_new_logo_title, + content: [ + GuidesText( + text: appLocalizations.guide_nutriscore_v2_new_logo_text, + ), + GuidesImage( + imagePath: + 'assets/cache/nutriscore-a-new-${AppLocalizations.of(context).guide_nutriscore_v2_file_language}.svg', + caption: appLocalizations.guide_nutriscore_v2_new_logo_image_caption, + desiredWidthPercent: 0.30, + ), + ], + ); + } +} + +class _NutriScoreSection4 extends StatelessWidget { + const _NutriScoreSection4(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesParagraph( + title: appLocalizations.guide_nutriscore_v2_where_title, + content: [ + GuidesText(text: appLocalizations.guide_nutriscore_v2_where_paragraph1), + GuidesText(text: appLocalizations.guide_nutriscore_v2_where_paragraph2), + GuidesIllustratedText( + text: appLocalizations.guide_nutriscore_v2_where_paragraph3, + imagePath: 'assets/app/release_icon_light_transparent_no_border.svg', + desiredWidthPercent: 0.15, + ) + ], + ); + } +} + +class _NutriScoreSection5 extends StatelessWidget { + const _NutriScoreSection5(); + + @override + Widget build(BuildContext context) { + final AppLocalizations appLocalizations = AppLocalizations.of(context); + + return GuidesParagraph( + title: appLocalizations.guide_nutriscore_v2_unchanged_title, + content: [ + GuidesText( + text: appLocalizations.guide_nutriscore_v2_unchanged_paragraph1, + ), + GuidesText( + text: appLocalizations.guide_nutriscore_v2_unchanged_paragraph2, + ), + ], + ); + } +}