From e4391ac4655d74ea02376513beb0202ffd6200c0 Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Sun, 8 Mar 2026 04:26:33 +0800 Subject: [PATCH] Minor layout fixes --- lib/screens/tasks/task_detail_screen.dart | 11 +- lib/widgets/qr_verification_dialog.dart | 121 ++++++++++++---------- 2 files changed, 74 insertions(+), 58 deletions(-) diff --git a/lib/screens/tasks/task_detail_screen.dart b/lib/screens/tasks/task_detail_screen.dart index 500696fb..eb36e1c8 100644 --- a/lib/screens/tasks/task_detail_screen.dart +++ b/lib/screens/tasks/task_detail_screen.dart @@ -2817,6 +2817,9 @@ class _TaskDetailScreenState extends ConsumerState ), ); + final mobileTabbedHeight = + (MediaQuery.of(context).size.height * 0.65).clamp(360.0, 720.0); + final mainContent = isWide ? Row( children: [ @@ -2831,9 +2834,11 @@ class _TaskDetailScreenState extends ConsumerState slivers: [ SliverToBoxAdapter(child: detailsCard), const SliverToBoxAdapter(child: SizedBox(height: 12)), - SliverFillRemaining( - hasScrollBody: true, - child: tabbedCard, + SliverToBoxAdapter( + child: SizedBox( + height: mobileTabbedHeight, + child: tabbedCard, + ), ), ], ), diff --git a/lib/widgets/qr_verification_dialog.dart b/lib/widgets/qr_verification_dialog.dart index 915b899a..0daaefa4 100644 --- a/lib/widgets/qr_verification_dialog.dart +++ b/lib/widgets/qr_verification_dialog.dart @@ -122,65 +122,76 @@ class _QrVerificationDialogState extends ConsumerState<_QrVerificationDialog> { final colors = theme.colorScheme; final qrData = 'tasq://verify/${widget.session.id}'; - return AlertDialog( + return Dialog( shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)), - title: Row( - children: [ - Icon(Icons.qr_code_2, color: colors.primary), - const SizedBox(width: 12), - const Expanded(child: Text('Scan with Mobile')), - ], - ), - content: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 360), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Text( - widget.session.type == 'enrollment' - ? 'Open the TasQ app on your phone and scan this QR code to enroll your face with liveness detection.' - : 'Open the TasQ app on your phone and scan this QR code to verify your face with liveness detection.', - style: theme.textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - ), + child: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 420), + child: Padding( + padding: const EdgeInsets.fromLTRB(24, 20, 24, 16), + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Icon(Icons.qr_code_2, color: colors.primary), + const SizedBox(width: 12), + const Expanded(child: Text('Scan with Mobile')), + ], + ), + const SizedBox(height: 16), + Text( + widget.session.type == 'enrollment' + ? 'Open the TasQ app on your phone and scan this QR code to enroll your face with liveness detection.' + : 'Open the TasQ app on your phone and scan this QR code to verify your face with liveness detection.', + style: theme.textTheme.bodyMedium?.copyWith( + color: colors.onSurfaceVariant, + ), + ), + const SizedBox(height: 24), + Center( + child: _expired + ? _buildExpiredState(theme, colors) + : _buildQrCode(theme, colors, qrData), + ), + const SizedBox(height: 16), + if (!_expired) + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 16, + height: 16, + child: CircularProgressIndicator( + strokeWidth: 2, + color: colors.primary, + ), + ), + const SizedBox(width: 12), + Flexible( + child: Text( + 'Waiting for mobile verification...', + style: theme.textTheme.bodySmall?.copyWith( + color: colors.onSurfaceVariant, + ), + ), + ), + ], + ), + const SizedBox(height: 12), + Align( + alignment: Alignment.centerRight, + child: TextButton( + onPressed: () => Navigator.of(context).pop(false), + child: const Text('Cancel'), + ), + ), + ], ), - const SizedBox(height: 24), - if (_expired) - _buildExpiredState(theme, colors) - else - _buildQrCode(theme, colors, qrData), - const SizedBox(height: 16), - if (!_expired) ...[ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox( - width: 16, - height: 16, - child: CircularProgressIndicator( - strokeWidth: 2, - color: colors.primary, - ), - ), - const SizedBox(width: 12), - Text( - 'Waiting for mobile verification...', - style: theme.textTheme.bodySmall?.copyWith( - color: colors.onSurfaceVariant, - ), - ), - ], - ), - ], - ], + ), ), ), - actions: [ - TextButton( - onPressed: () => Navigator.of(context).pop(false), - child: const Text('Cancel'), - ), - ], ); }