Skip to content

Commit

Permalink
Set max width of ads info dialog (#1770)
Browse files Browse the repository at this point in the history
| 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)
|
  • Loading branch information
nilsreichardt authored Oct 16, 2024
1 parent 6562c03 commit 7f475ae
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions app/lib/ads/ad_info_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,22 @@ import 'package:sharezone_widgets/sharezone_widgets.dart';
void showAdInfoDialog(BuildContext context) async {
final navigateToPlusPage = await showDialog<bool>(
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(
Expand Down Expand Up @@ -46,11 +60,7 @@ void showAdInfoDialog(BuildContext context) async {
onPressed: () => Navigator.of(context).pop(),
),
],
);
},
);

if (navigateToPlusPage == true && context.mounted) {
navigateToSharezonePlusPage(context);
),
);
}
}

0 comments on commit 7f475ae

Please sign in to comment.