Minor layout fixes

This commit is contained in:
Marc Rejohn Castillano 2026-03-08 04:26:33 +08:00
parent c644143198
commit e4391ac465
2 changed files with 74 additions and 58 deletions

View File

@ -2817,6 +2817,9 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
), ),
); );
final mobileTabbedHeight =
(MediaQuery.of(context).size.height * 0.65).clamp(360.0, 720.0);
final mainContent = isWide final mainContent = isWide
? Row( ? Row(
children: [ children: [
@ -2831,9 +2834,11 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
slivers: [ slivers: [
SliverToBoxAdapter(child: detailsCard), SliverToBoxAdapter(child: detailsCard),
const SliverToBoxAdapter(child: SizedBox(height: 12)), const SliverToBoxAdapter(child: SizedBox(height: 12)),
SliverFillRemaining( SliverToBoxAdapter(
hasScrollBody: true, child: SizedBox(
child: tabbedCard, height: mobileTabbedHeight,
child: tabbedCard,
),
), ),
], ],
), ),

View File

@ -122,65 +122,76 @@ class _QrVerificationDialogState extends ConsumerState<_QrVerificationDialog> {
final colors = theme.colorScheme; final colors = theme.colorScheme;
final qrData = 'tasq://verify/${widget.session.id}'; final qrData = 'tasq://verify/${widget.session.id}';
return AlertDialog( return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(28)),
title: Row( child: ConstrainedBox(
children: [ constraints: const BoxConstraints(maxWidth: 420),
Icon(Icons.qr_code_2, color: colors.primary), child: Padding(
const SizedBox(width: 12), padding: const EdgeInsets.fromLTRB(24, 20, 24, 16),
const Expanded(child: Text('Scan with Mobile')), child: SingleChildScrollView(
], child: Column(
), mainAxisSize: MainAxisSize.min,
content: ConstrainedBox( crossAxisAlignment: CrossAxisAlignment.start,
constraints: const BoxConstraints(maxWidth: 360), children: [
child: Column( Row(
mainAxisSize: MainAxisSize.min, children: [
children: [ Icon(Icons.qr_code_2, color: colors.primary),
Text( const SizedBox(width: 12),
widget.session.type == 'enrollment' const Expanded(child: Text('Scan with Mobile')),
? '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( const SizedBox(height: 16),
color: colors.onSurfaceVariant, 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'),
),
],
); );
} }