Minor layout fixes

This commit is contained in:
2026-03-08 04:26:33 +08:00
parent c644143198
commit e4391ac465
2 changed files with 74 additions and 58 deletions
+66 -55
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'),
),
],
);
}