From c4210201e6d77c0991fb5e5846504dd214cfa001 Mon Sep 17 00:00:00 2001 From: Valentin REVERSAT Date: Mon, 11 Sep 2023 22:22:40 +0200 Subject: [PATCH] fix(ui): move the button when the screen is in portrait mode on the about screen --- .../chabo_about_screen.dart | 109 ++++++++++-------- 1 file changed, 62 insertions(+), 47 deletions(-) diff --git a/lib/screens/chabo_about_screen/chabo_about_screen.dart b/lib/screens/chabo_about_screen/chabo_about_screen.dart index e05b9d43..56136a9c 100644 --- a/lib/screens/chabo_about_screen/chabo_about_screen.dart +++ b/lib/screens/chabo_about_screen/chabo_about_screen.dart @@ -119,41 +119,54 @@ class ChaboAboutScreen extends StatelessWidget { ), ), ), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 16.0, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( + Padding( + padding: const EdgeInsets.symmetric( + horizontal: 16.0, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Text( + snapshot.data!.appName, + style: Theme.of(context) + .textTheme + .headlineSmall! + .copyWith( + fontWeight: FontWeight.bold, + fontSize: 30, + ), + ), + Text( + ' | v${snapshot.data!.version} (${snapshot.data!.buildNumber})', + style: textTheme.bodyMedium, + ), + ], + ), + Text( + Const.legalLease, + style: textTheme.bodySmall!.copyWith(), + ), + ], + ), + ), + DeviceHelper.isPortrait(context) + ? const SizedBox.shrink() + : Flexible( + child: Wrap( + alignment: WrapAlignment.center, + runSpacing: 20, children: [ - Text( - snapshot.data!.appName, - style: Theme.of(context) - .textTheme - .headlineSmall! - .copyWith( - fontWeight: FontWeight.bold, - fontSize: 30, - ), - ), - Text( - ' | v${snapshot.data!.version} (${snapshot.data!.buildNumber})', - style: textTheme.bodyMedium, + _PageLinksWidget( + packageInfo: snapshot.data!, + iconWidget: _iconWidget, ), + const _StoreRateWidget(), ], ), - Text( - Const.legalLease, - style: textTheme.bodySmall!.copyWith(), - ), - ], - ), - ), - ), + ), ], ), ), @@ -202,22 +215,24 @@ class ChaboAboutScreen extends StatelessWidget { const SizedBox( height: 15, ), - Padding( - padding: const EdgeInsets.symmetric( - horizontal: 35.0, - ), - child: Wrap( - alignment: WrapAlignment.center, - runSpacing: 20, - children: [ - _PageLinksWidget( - packageInfo: snapshot.data!, - iconWidget: _iconWidget, - ), - const _StoreRateWidget(), - ], - ), - ), + DeviceHelper.isPortrait(context) + ? Padding( + padding: const EdgeInsets.symmetric( + horizontal: 35.0, + ), + child: Wrap( + alignment: WrapAlignment.center, + runSpacing: 20, + children: [ + _PageLinksWidget( + packageInfo: snapshot.data!, + iconWidget: _iconWidget, + ), + const _StoreRateWidget(), + ], + ), + ) + : const SizedBox.shrink(), ], ), ),