From 7f475aee16e3852a31395d7794dece3005da50f1 Mon Sep 17 00:00:00 2001 From: Nils Reichardt Date: Thu, 17 Oct 2024 00:13:44 +0200 Subject: [PATCH] Set max width of ads info dialog (#1770) | Before | After | |--------|--------| | ![Simulator Screenshot - iPad Pro 13-inch (M4) - 2024-10-16 at 22 43 07](https://github.com/user-attachments/assets/d521cca5-c3a9-4086-84af-ba9143fdc7f9) | ![Simulator Screenshot - iPad Pro 13-inch (M4) - 2024-10-16 at 22 44 41](https://github.com/user-attachments/assets/8941971d-72a3-41e0-9175-f57ca785e529) | --- app/lib/ads/ad_info_dialog.dart | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/app/lib/ads/ad_info_dialog.dart b/app/lib/ads/ad_info_dialog.dart index b428df9b8..ca8e8a7af 100644 --- a/app/lib/ads/ad_info_dialog.dart +++ b/app/lib/ads/ad_info_dialog.dart @@ -14,8 +14,22 @@ import 'package:sharezone_widgets/sharezone_widgets.dart'; void showAdInfoDialog(BuildContext context) async { final navigateToPlusPage = await showDialog( context: context, - builder: (BuildContext context) { - return AlertDialog( + builder: (BuildContext context) => const _Dialog(), + ); + + if (navigateToPlusPage == true && context.mounted) { + navigateToSharezonePlusPage(context); + } +} + +class _Dialog extends StatelessWidget { + const _Dialog(); + + @override + Widget build(BuildContext context) { + return MaxWidthConstraintBox( + maxWidth: 500, + child: AlertDialog( title: const Text('Werbung in Sharezone'), content: Text.rich( TextSpan( @@ -46,11 +60,7 @@ void showAdInfoDialog(BuildContext context) async { onPressed: () => Navigator.of(context).pop(), ), ], - ); - }, - ); - - if (navigateToPlusPage == true && context.mounted) { - navigateToSharezonePlusPage(context); + ), + ); } }