From 4364da41b84566e15b0a53a2609aedf6a878705a Mon Sep 17 00:00:00 2001 From: Erick Date: Mon, 23 Jan 2023 18:34:03 -0300 Subject: [PATCH] feat: adding the new layout to the landing page (#421) * feat: adding the new layout to the landing page * fix: lint Co-authored-by: Tom Arra --- lib/footer/widgets/full_footer.dart | 43 +++++++++--------- lib/landing/view/landing_page.dart | 14 ++---- lib/landing/widgets/landing_body.dart | 63 ++++++++++++++++++--------- 3 files changed, 69 insertions(+), 51 deletions(-) diff --git a/lib/footer/widgets/full_footer.dart b/lib/footer/widgets/full_footer.dart index f4031c1b..a564dab3 100644 --- a/lib/footer/widgets/full_footer.dart +++ b/lib/footer/widgets/full_footer.dart @@ -73,28 +73,31 @@ class FullFooter extends StatelessWidget { ); }, large: (context, child) { - return Padding( - padding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 24, - ), - child: Row( - children: [ - for (final icon in icons) ...[ - icon, - gap, - ], - Expanded( - child: Align( - alignment: Alignment.centerRight, - child: child, + return Align( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 32, + vertical: 24, + ), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + for (final icon in icons) ...[ + icon, + gap, + ], + Expanded( + child: Align( + alignment: Alignment.bottomRight, + child: child, + ), ), - ), - if (!_platformHelper.isMobile) ...[ - gap, - const MuteButton(), + if (!_platformHelper.isMobile) ...[ + gap, + const MuteButton(), + ], ], - ], + ), ), ); }, diff --git a/lib/landing/view/landing_page.dart b/lib/landing/view/landing_page.dart index 572cde3e..f1e56768 100644 --- a/lib/landing/view/landing_page.dart +++ b/lib/landing/view/landing_page.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:holobooth/footer/footer.dart'; import 'package:holobooth/landing/landing.dart'; import 'package:holobooth_ui/holobooth_ui.dart'; @@ -21,19 +20,14 @@ class LandingView extends StatelessWidget { @override Widget build(BuildContext context) { return Stack( - children: [ - const Positioned.fill( + children: const [ + Positioned.fill( child: LandingBackground(), ), Positioned.fill( - child: Column( - children: [ - const Expanded(child: LandingBody()), - FullFooter(showIconsForSmall: false), - ], - ), + child: LandingBody(), ), - const Positioned( + Positioned( bottom: 100, right: 0, child: ClassicPhotoboothBanner(), diff --git a/lib/landing/widgets/landing_body.dart b/lib/landing/widgets/landing_body.dart index d1196552..c827b452 100644 --- a/lib/landing/widgets/landing_body.dart +++ b/lib/landing/widgets/landing_body.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:holobooth/assets/assets.dart'; +import 'package:holobooth/footer/footer.dart'; import 'package:holobooth/l10n/l10n.dart'; import 'package:holobooth/landing/landing.dart'; import 'package:holobooth_ui/holobooth_ui.dart'; @@ -24,21 +25,36 @@ class _SmallLandingBody extends StatelessWidget { @override Widget build(BuildContext context) { - return SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 32), - child: Column( - children: [ - const SizedBox(height: 46), - const _LandingBodyContent(smallScreen: true), - const SizedBox(height: 34), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Assets.backgrounds.holobooth.image( - key: LandingBody.landingPageImageKey, + return CustomScrollView( + slivers: [ + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 32), + child: Column( + children: const [ + SizedBox(height: 46), + _LandingBodyContent(smallScreen: true), + SizedBox(height: 34), + ], ), ), - ], - ), + ), + SliverFillRemaining( + hasScrollBody: false, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Assets.backgrounds.holobooth.image( + key: LandingBody.landingPageImageKey, + ), + ), + FullFooter(showIconsForSmall: false), + ], + ), + ), + ], ); } } @@ -49,15 +65,16 @@ class _LargeLandingBody extends StatelessWidget { @override Widget build(BuildContext context) { return Align( - child: SingleChildScrollView( - padding: const EdgeInsets.symmetric(horizontal: 32), - child: Column( - children: [ - Row( + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Expanded( + flex: 7, + child: Row( children: [ Expanded( child: Container( - alignment: Alignment.center, + alignment: Alignment.bottomCenter, child: Assets.backgrounds.holobooth.image( key: LandingBody.landingPageImageKey, ), @@ -69,8 +86,12 @@ class _LargeLandingBody extends StatelessWidget { ), ], ), - ], - ), + ), + Expanded( + flex: 3, + child: FullFooter(showIconsForSmall: false), + ), + ], ), ); }