From 8633fae35ee087416976d03a15008018d77c270e Mon Sep 17 00:00:00 2001 From: Enzo Conty Date: Mon, 8 Jan 2024 09:14:38 +0100 Subject: [PATCH] fix: fixing some UI padding & styling after feedback. --- .../app_center/lib/src/snapd/snap_page.dart | 5 ++- .../app_center/lib/src/snapd/snap_report.dart | 33 ++++++++++++------- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/packages/app_center/lib/src/snapd/snap_page.dart b/packages/app_center/lib/src/snapd/snap_page.dart index 29130b7c7..66ac4696e 100644 --- a/packages/app_center/lib/src/snapd/snap_page.dart +++ b/packages/app_center/lib/src/snapd/snap_page.dart @@ -587,7 +587,10 @@ class _Header extends ConsumerWidget { showDialog( context: context, builder: (context) { - return SnapReport(name: snapModel.snap.titleOrName); + return ResponsiveLayoutBuilder( + builder: (context) => + SnapReport(name: snapModel.snap.titleOrName), + ); }, ); }, diff --git a/packages/app_center/lib/src/snapd/snap_report.dart b/packages/app_center/lib/src/snapd/snap_report.dart index fb6fec635..4921c4a39 100644 --- a/packages/app_center/lib/src/snapd/snap_report.dart +++ b/packages/app_center/lib/src/snapd/snap_report.dart @@ -1,4 +1,5 @@ import 'package:app_center/l10n.dart'; +import 'package:app_center/layout.dart'; import 'package:app_center/src/snapd/logger.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; @@ -25,11 +26,12 @@ class _SnapReportState extends State { final l10n = AppLocalizations.of(context); final textTheme = Theme.of(context).textTheme; final titleTextStyle = textTheme.headlineSmall!; + final layout = ResponsiveLayout.of(context); return Dialog( child: Container( - padding: const EdgeInsets.all(16.0), - width: double.infinity, + width: layout.cardSize.width * 2 + kCardSpacing, + padding: const EdgeInsets.all(kCardSpacing), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -39,7 +41,10 @@ class _SnapReportState extends State { padding: EdgeInsets.symmetric(vertical: 10.0), child: Divider(), ), - Text(l10n.snapReportSelectReportReasonLabel), + Padding( + padding: const EdgeInsets.symmetric(vertical: kCardMargin), + child: Text(l10n.snapReportSelectReportReasonLabel), + ), MenuButtonBuilder( entries: [ l10n.snapReportOptionCopyrightViolation, @@ -66,9 +71,12 @@ class _SnapReportState extends State { ), ), const SizedBox( - height: 20, + height: kPagePadding, + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: kCardMargin), + child: Text(l10n.snapReportDetailsLabel), ), - Text(l10n.snapReportDetailsLabel), SizedBox( height: 100, child: TextField( @@ -87,10 +95,13 @@ class _SnapReportState extends State { ), ), const SizedBox( - height: 20, + height: kPagePadding, ), - Text( - l10n.snapReportOptionalEmailAddressLabel, + Padding( + padding: const EdgeInsets.symmetric(vertical: kCardMargin), + child: Text( + l10n.snapReportOptionalEmailAddressLabel, + ), ), TextFormField( decoration: InputDecoration( @@ -112,7 +123,7 @@ class _SnapReportState extends State { controller: _emailController, ), Padding( - padding: const EdgeInsets.symmetric(vertical: 20.0), + padding: const EdgeInsets.symmetric(vertical: kPagePadding), child: RichText( text: TextSpan( children: [ @@ -154,11 +165,11 @@ class _SnapReportState extends State { Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - TextButton( + OutlinedButton( onPressed: () => Navigator.of(context).pop(), child: Text(l10n.snapReportCancelButtonLabel), ), - const SizedBox(width: 20.0), + const SizedBox(width: kPagePadding), ElevatedButton( onPressed: () async { if (selectedReason == null ||