Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/licence dialog small screen #355 #439

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 50 additions & 28 deletions lib/features/about_us_view/utils/custom_license_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ Future<void> showCustomLicenseDialog({
await showDialog<void>(
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,
),
),
);
},
);
},
);
Expand Down Expand Up @@ -54,35 +66,45 @@ class _AlertDialog extends StatelessWidget {
),
actions: <Widget>[
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();
},
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down