diff --git a/lib/features/about_us_view/utils/custom_license_dialog.dart b/lib/features/about_us_view/utils/custom_license_dialog.dart index 1fe88c00..2822410a 100644 --- a/lib/features/about_us_view/utils/custom_license_dialog.dart +++ b/lib/features/about_us_view/utils/custom_license_dialog.dart @@ -14,11 +14,23 @@ Future showCustomLicenseDialog({ await showDialog( context: context, builder: (BuildContext context) { - return _AlertDialog( - applicationName: applicationName, - applicationVersion: applicationVersion, - applicationLegalese: applicationLegalese, - applicationIcon: applicationIcon, + return LayoutBuilder( + builder: (context, constraints) { + final double maxWidth = MediaQuery.of(context).size.width * 0.89; + return Center( + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: maxWidth, + ), + child: _AlertDialog( + applicationName: applicationName, + applicationVersion: applicationVersion, + applicationLegalese: applicationLegalese, + applicationIcon: applicationIcon, + ), + ), + ); + }, ); }, ); @@ -54,35 +66,45 @@ class _AlertDialog extends StatelessWidget { ), actions: [ Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - TextButton( - child: Text( - context.localize.show_license, - style: context.textTheme.bodyOrange.copyWith( - fontSize: AboutUsConfig.dialogButtonFontSize, + Flexible( + child: TextButton( + child: Text( + context.localize.show_license, + style: context.textTheme.bodyOrange.copyWith( + fontSize: AboutUsConfig.dialogButtonFontSize, + ), + textAlign: TextAlign.center, + maxLines: 2, + overflow: TextOverflow.ellipsis, ), + onPressed: () { + showLicensePage( + context: context, + applicationName: applicationName, + applicationIcon: applicationIcon, + applicationVersion: applicationVersion, + applicationLegalese: applicationLegalese, + ); + }, ), - onPressed: () { - showLicensePage( - context: context, - applicationName: applicationName, - applicationIcon: applicationIcon, - applicationVersion: applicationVersion, - applicationLegalese: applicationLegalese, - ); - }, ), - TextButton( - child: Text( - context.localize.close, - style: context.textTheme.body.copyWith( - fontSize: AboutUsConfig.dialogButtonFontSize, + Flexible( + child: TextButton( + child: Text( + context.localize.close, + style: context.textTheme.body.copyWith( + fontSize: AboutUsConfig.dialogButtonFontSize, + ), + textAlign: TextAlign.center, + maxLines: 1, + overflow: TextOverflow.ellipsis, ), + onPressed: () { + Navigator.of(context).pop(); + }, ), - onPressed: () { - Navigator.of(context).pop(); - }, ), ], ), diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index e51f5519..84a7be80 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -98,7 +98,7 @@ "until_the_end_of_the_semester_break": "do końca przerwy międzysemestralnej", "until_the_session_ends": "do zakończenia sesji", "app_info": "(informacje o aplikacji)", - "show_license": "Wyświelt licencję", + "show_license": "Wyświetl licencję", "close": "Zamknij", "no_version": "Brak wersji", "places_currently_available": "Aktualnie wolne miejsca",