ui: reducir tamaño de botones pánico y soporte en MensajeríaPage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
4fd962ac8c
commit
c52bb090b3
@@ -148,120 +148,92 @@ class _MensajeriaPageState extends State<MensajeriaPage> {
|
||||
],
|
||||
);
|
||||
|
||||
// ── Tarjetas de acción rápida ──────────────────────────────────────────────
|
||||
// ── Tarjetas de acción rápida (compactas) ────────────────────────────────
|
||||
Widget _tarjetasAccion() => Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 16, 16, 0),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _accionCard(
|
||||
color: AppColors.error,
|
||||
bgColor: const Color(0xFF2A0A0A),
|
||||
borderColor: AppColors.error,
|
||||
icon: Icons.warning_rounded,
|
||||
titulo: 'BOTÓN DE\nPÁNICO',
|
||||
descripcion: 'Activa alerta de emergencia inmediata',
|
||||
labelBoton: 'ACTIVAR',
|
||||
onTap: () async {
|
||||
final m = Mensaje(
|
||||
texto: 'ALERTA DE PÁNICO ACTIVADA. Requiero asistencia inmediata.',
|
||||
esMio: true,
|
||||
hora: _horaActual(),
|
||||
timestamp: DateTime.now().toIso8601String(),
|
||||
);
|
||||
await _dao.insert(m);
|
||||
await _cargar();
|
||||
},
|
||||
),
|
||||
padding: const EdgeInsets.fromLTRB(16, 10, 16, 0),
|
||||
child: Row(children: [
|
||||
Expanded(
|
||||
child: _accionChip(
|
||||
color: AppColors.error,
|
||||
bgColor: const Color(0xFF2A0A0A),
|
||||
icon: Icons.warning_rounded,
|
||||
label: 'PÁNICO',
|
||||
labelBoton: 'ACTIVAR',
|
||||
onTap: () async {
|
||||
final m = Mensaje(
|
||||
texto: 'ALERTA DE PÁNICO ACTIVADA. Requiero asistencia inmediata.',
|
||||
esMio: true,
|
||||
hora: _horaActual(),
|
||||
timestamp: DateTime.now().toIso8601String(),
|
||||
);
|
||||
await _dao.insert(m);
|
||||
await _cargar();
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _accionCard(
|
||||
color: AppColors.primary,
|
||||
bgColor: const Color(0xFF001228),
|
||||
borderColor: AppColors.primary,
|
||||
icon: Icons.headset_mic_rounded,
|
||||
titulo: 'SOPORTE Y\nASISTENCIA',
|
||||
descripcion: 'Comunícate con nuestro equipo 24/7',
|
||||
labelBoton: 'CONTACTAR',
|
||||
onTap: () async {
|
||||
final m = Mensaje(
|
||||
texto: 'Hola, necesito asistencia técnica.',
|
||||
esMio: true,
|
||||
hora: _horaActual(),
|
||||
timestamp: DateTime.now().toIso8601String(),
|
||||
);
|
||||
await _dao.insert(m);
|
||||
await _cargar();
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: _accionChip(
|
||||
color: AppColors.primary,
|
||||
bgColor: const Color(0xFF001228),
|
||||
icon: Icons.headset_mic_rounded,
|
||||
label: 'SOPORTE',
|
||||
labelBoton: 'CONTACTAR',
|
||||
onTap: () async {
|
||||
final m = Mensaje(
|
||||
texto: 'Hola, necesito asistencia técnica.',
|
||||
esMio: true,
|
||||
hora: _horaActual(),
|
||||
timestamp: DateTime.now().toIso8601String(),
|
||||
);
|
||||
await _dao.insert(m);
|
||||
await _cargar();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
|
||||
Widget _accionCard({
|
||||
Widget _accionChip({
|
||||
required Color color,
|
||||
required Color bgColor,
|
||||
required Color borderColor,
|
||||
required IconData icon,
|
||||
required String titulo,
|
||||
required String descripcion,
|
||||
required String label,
|
||||
required String labelBoton,
|
||||
required VoidCallback onTap,
|
||||
}) =>
|
||||
Container(
|
||||
padding: const EdgeInsets.all(14),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: borderColor.withOpacity(0.4), width: 1),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: color.withOpacity(0.35), width: 1),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
child: Row(children: [
|
||||
Icon(icon, color: color, size: 18),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(label,
|
||||
style: appLabel(
|
||||
size: 11, weight: FontWeight.bold,
|
||||
color: AppColors.onSurface, spacing: 0.5)),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 5),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(0.15),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(icon, color: color, size: 22),
|
||||
child: Text(labelBoton,
|
||||
style: appLabel(
|
||||
size: 10, weight: FontWeight.bold,
|
||||
color: Colors.white, spacing: 0.5)),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(titulo,
|
||||
style: appHeadline(
|
||||
size: 13, weight: FontWeight.w800,
|
||||
color: AppColors.onSurface)),
|
||||
const SizedBox(height: 4),
|
||||
Text(descripcion,
|
||||
style: appLabel(size: 10, color: AppColors.onSurfaceVariant),
|
||||
maxLines: 2),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
onPressed: onTap,
|
||||
style: ElevatedButton.styleFrom(
|
||||
primary: color,
|
||||
onPrimary: Colors.white,
|
||||
padding: const EdgeInsets.symmetric(vertical: 9),
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Text(labelBoton,
|
||||
style: appLabel(
|
||||
size: 11,
|
||||
weight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
spacing: 1.5)),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
|
||||
String _horaActual() {
|
||||
|
||||
Reference in New Issue
Block a user