From 37b839d54e1f1e2257cca27901e6f76678c2a8e8 Mon Sep 17 00:00:00 2001 From: arturplaczek <33895544+arturplaczek@users.noreply.github.com> Date: Thu, 5 May 2022 15:10:21 +0200 Subject: [PATCH] fix: HowToPlayDialog fit (#344) Co-authored-by: Tom Arra --- .../widgets/how_to_play_dialog.dart | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/lib/how_to_play/widgets/how_to_play_dialog.dart b/lib/how_to_play/widgets/how_to_play_dialog.dart index 426fcbe5..5ac1ef2a 100644 --- a/lib/how_to_play/widgets/how_to_play_dialog.dart +++ b/lib/how_to_play/widgets/how_to_play_dialog.dart @@ -96,7 +96,9 @@ class _HowToPlayDialogState extends State { child: PinballDialog( title: l10n.howToPlay, subtitle: l10n.tipsForFlips, - child: isMobile ? const _MobileBody() : const _DesktopBody(), + child: FittedBox( + child: isMobile ? const _MobileBody() : const _DesktopBody(), + ), ), ); } @@ -109,18 +111,16 @@ class _MobileBody extends StatelessWidget { Widget build(BuildContext context) { final paddingWidth = MediaQuery.of(context).size.width * 0.15; final paddingHeight = MediaQuery.of(context).size.height * 0.075; - return FittedBox( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: paddingWidth, - ), - child: Column( - children: [ - const _MobileLaunchControls(), - SizedBox(height: paddingHeight), - const _MobileFlipperControls(), - ], - ), + return Padding( + padding: EdgeInsets.symmetric( + horizontal: paddingWidth, + ), + child: Column( + children: [ + const _MobileLaunchControls(), + SizedBox(height: paddingHeight), + const _MobileFlipperControls(), + ], ), ); } @@ -189,13 +189,15 @@ class _DesktopBody extends StatelessWidget { @override Widget build(BuildContext context) { - return ListView( - children: const [ - SizedBox(height: 16), - _DesktopLaunchControls(), - SizedBox(height: 16), - _DesktopFlipperControls(), - ], + return Padding( + padding: const EdgeInsets.all(16), + child: Column( + children: const [ + _DesktopLaunchControls(), + SizedBox(height: 16), + _DesktopFlipperControls(), + ], + ), ); } }