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
? Row(
children: [
@ -2831,9 +2834,11 @@ class _TaskDetailScreenState extends ConsumerState<TaskDetailScreen>
slivers: [
SliverToBoxAdapter(child: detailsCard),
const SliverToBoxAdapter(child: SizedBox(height: 12)),
SliverFillRemaining(
hasScrollBody: true,
child: tabbedCard,
SliverToBoxAdapter(
child: SizedBox(
height: mobileTabbedHeight,
child: tabbedCard,
),
),
],
),

View File

@ -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'),
),
],
);
}