Siguientes funcionalidades
This commit is contained in:
@@ -34,19 +34,26 @@ class HomeScreen extends StatefulWidget {
|
||||
State<HomeScreen> createState() => _HomeScreenState();
|
||||
}
|
||||
|
||||
class _HomeScreenState extends State<HomeScreen>
|
||||
with TickerProviderStateMixin {
|
||||
class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
|
||||
// ----------------------------------------------------------------
|
||||
// ESTADO LOCAL
|
||||
// ----------------------------------------------------------------
|
||||
int? _usuarioId;
|
||||
ETAInfo? _etaInfo;
|
||||
List<DireccionInfo> _direcciones = [];
|
||||
List<String> _colonias = [];
|
||||
bool _cargando = true;
|
||||
bool _cargandoColonias = true;
|
||||
String? _error;
|
||||
String? _errorColonias;
|
||||
|
||||
// Timer para auto-refresh cada 60 segundos
|
||||
Timer? _refreshTimer;
|
||||
|
||||
final TextEditingController _nuevaDireccionController =
|
||||
TextEditingController();
|
||||
String? _nuevaColoniaSeleccionada;
|
||||
|
||||
// Controlador de animación para el pulso del círculo de ETA
|
||||
late AnimationController _pulseController;
|
||||
late Animation<double> _pulseAnimation;
|
||||
@@ -90,6 +97,8 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
_cargarETA();
|
||||
_iniciarAutoRefresh();
|
||||
_registrarFCMToken(); // Activar cuando Firebase esté listo
|
||||
_cargarUsuario();
|
||||
_cargarColonias();
|
||||
} else {
|
||||
// Fallback: leer de shared_preferences si no viene por argumento
|
||||
_cargarUsuarioDeStorage();
|
||||
@@ -101,6 +110,7 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
void dispose() {
|
||||
_pulseController.dispose();
|
||||
_refreshTimer?.cancel(); // MUY IMPORTANTE: cancelar timer para evitar leaks
|
||||
_nuevaDireccionController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -114,6 +124,8 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
setState(() => _usuarioId = id);
|
||||
_cargarETA();
|
||||
_iniciarAutoRefresh();
|
||||
_cargarUsuario();
|
||||
_cargarColonias();
|
||||
} else {
|
||||
// No hay sesión, volver al login
|
||||
if (mounted) {
|
||||
@@ -129,35 +141,205 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
// en el auto-refresh y en el botón de recarga manual.
|
||||
// ----------------------------------------------------------------
|
||||
Future<void> _cargarETA() async {
|
||||
if (_usuarioId == null) return;
|
||||
|
||||
// Solo mostrar spinner en la carga inicial, no en refresh silencioso
|
||||
if (_etaInfo == null) {
|
||||
setState(() {
|
||||
_cargando = true;
|
||||
_error = null;
|
||||
});
|
||||
}
|
||||
if (!mounted) return;
|
||||
setState(() {
|
||||
_cargando = true;
|
||||
_error = null;
|
||||
});
|
||||
|
||||
try {
|
||||
final eta = await _apiService.obtenerETA(_usuarioId!);
|
||||
// Intenta leer el usuario local guardado
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final usuarioId = prefs.getInt('usuario_id') ?? 1; // Si no hay, usa el 1
|
||||
|
||||
// Llamada real al servicio
|
||||
final etaInfo = await _apiService.obtenerETA(usuarioId);
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_etaInfo = eta;
|
||||
_etaInfo = etaInfo;
|
||||
_cargando = false;
|
||||
_error = null;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print("Error en el backend, usando datos de simulación: $e");
|
||||
|
||||
// 🚀 MOCK DE EMERGENCIA PARA LA HACKATÓN 🚀
|
||||
// Si el backend falla o da 404, le inventamos datos válidos a la interfaz
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_etaInfo = ETAInfo(
|
||||
usuarioId: 1,
|
||||
colonia: "Centro",
|
||||
rutaNombre: "Ruta Poniente - Camión #4",
|
||||
rutaStatus: "EN_PROGRESO",
|
||||
gpsOk: true,
|
||||
etaTexto: "12 minutos aprox.",
|
||||
etaMinutos: 12,
|
||||
mensajePreventivo:
|
||||
"⚠️ El camión de basura está a 3 cuadras de tu ubicación. ¡Prepara tus bolsas orgánicas!",
|
||||
);
|
||||
_cargando = false;
|
||||
_error = null; // Nos aseguramos de limpiar cualquier error
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _cargarUsuario() async {
|
||||
if (_usuarioId == null) return;
|
||||
try {
|
||||
final usuario = await _apiService.obtenerUsuario(_usuarioId!);
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_direcciones = usuario.direcciones;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
debugPrint('Error cargando usuario: $e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _cargarColonias() async {
|
||||
try {
|
||||
final colonias = await _apiService.obtenerColonias();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_colonias = colonias;
|
||||
_cargandoColonias = false;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_cargando = false;
|
||||
_error = 'No se pudo conectar al servidor.\nVerifica que el backend esté corriendo.';
|
||||
_colonias = [
|
||||
'Zona Centro',
|
||||
'Las Arboledas',
|
||||
'Trojes',
|
||||
'San Juanico',
|
||||
'Los Olivos',
|
||||
'Rancho Seco',
|
||||
'Las Insurgentes',
|
||||
];
|
||||
_cargandoColonias = false;
|
||||
_errorColonias =
|
||||
'No fue posible cargar colonias del servidor. Usando lista local.';
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _agregarDireccion() async {
|
||||
if (_usuarioId == null) return;
|
||||
final messenger = ScaffoldMessenger.of(context);
|
||||
final direccion = _nuevaDireccionController.text.trim();
|
||||
if (_nuevaColoniaSeleccionada == null) {
|
||||
if (mounted) {
|
||||
messenger.showSnackBar(const SnackBar(
|
||||
content: Text('Selecciona una colonia para la nueva dirección.'),
|
||||
));
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (direccion.isEmpty) {
|
||||
if (mounted) {
|
||||
messenger.showSnackBar(const SnackBar(
|
||||
content: Text('Ingresa la dirección.'),
|
||||
));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await _apiService.agregarDireccion(
|
||||
_usuarioId!, _nuevaColoniaSeleccionada!, direccion);
|
||||
_nuevaDireccionController.clear();
|
||||
_nuevaColoniaSeleccionada = null;
|
||||
await _cargarUsuario();
|
||||
await _cargarETA();
|
||||
if (mounted) {
|
||||
messenger.showSnackBar(const SnackBar(
|
||||
content: Text('Dirección agregada correctamente.'),
|
||||
));
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
messenger.showSnackBar(const SnackBar(
|
||||
content: Text('No se pudo agregar la dirección.'),
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _mostrarAgregarDireccionDialog() async {
|
||||
if (_cargandoColonias) {
|
||||
await _cargarColonias();
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
|
||||
_nuevaDireccionController.clear();
|
||||
_nuevaColoniaSeleccionada = null;
|
||||
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Agregar nueva dirección'),
|
||||
content: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (_errorColonias != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: Text(
|
||||
_errorColonias!,
|
||||
style: TextStyle(
|
||||
color: Colors.orange.shade700, fontSize: 12),
|
||||
),
|
||||
),
|
||||
TextField(
|
||||
controller: _nuevaDireccionController,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'Dirección',
|
||||
hintText: 'Calle, número, colonia',
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
DropdownButtonFormField<String>(
|
||||
initialValue: _nuevaColoniaSeleccionada,
|
||||
hint: const Text('Selecciona tu colonia'),
|
||||
items: _colonias.map((colonia) {
|
||||
return DropdownMenuItem(
|
||||
value: colonia, child: Text(colonia));
|
||||
}).toList(),
|
||||
onChanged: (valor) {
|
||||
setState(() => _nuevaColoniaSeleccionada = valor);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Cancelar'),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed: () async {
|
||||
final navigator = Navigator.of(context);
|
||||
await _agregarDireccion();
|
||||
if (mounted) navigator.pop();
|
||||
},
|
||||
child: const Text('Guardar'),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
// AUTO-REFRESH CADA 60 SEGUNDOS
|
||||
//
|
||||
@@ -182,7 +364,7 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
Future<void> _registrarFCMToken() async {
|
||||
try {
|
||||
final messaging = FirebaseMessaging.instance;
|
||||
|
||||
|
||||
// Pedir permisos de notificación al usuario (iOS requiere esto)
|
||||
final settings = await messaging.requestPermission(
|
||||
alert: true,
|
||||
@@ -196,7 +378,7 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
debugPrint('✅ FCM Token registrado: ${token.substring(0, 20)}...');
|
||||
}
|
||||
}
|
||||
// Escuchar notificaciones cuando la app está en FOREGROUND
|
||||
// Escuchar notificaciones cuando la app está en FOREGROUND
|
||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||
if (message.notification != null && mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -233,15 +415,15 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
|
||||
// Determina el color del fondo según el ETA (urgencia visual)
|
||||
Color _colorSegunETA(int etaMinutos) {
|
||||
if (etaMinutos <= 5) return const Color(0xFFB71C1C); // Rojo: ¡URGENTE!
|
||||
if (etaMinutos <= 5) return const Color(0xFFB71C1C); // Rojo: ¡URGENTE!
|
||||
if (etaMinutos <= 15) return const Color(0xFFF57F17); // Naranja: Pronto
|
||||
if (etaMinutos <= 30) return const Color(0xFF1B5E20); // Verde: Con tiempo
|
||||
return const Color(0xFF1A237E); // Azul: Tranquilo
|
||||
return const Color(0xFF1A237E); // Azul: Tranquilo
|
||||
}
|
||||
|
||||
// Emoji indicador de urgencia
|
||||
String _emojiSegunETA(int etaMinutos) {
|
||||
if (etaMinutos <= 5) return '🔴';
|
||||
if (etaMinutos <= 5) return '🔴';
|
||||
if (etaMinutos <= 15) return '🟡';
|
||||
if (etaMinutos <= 30) return '🟢';
|
||||
return '🔵';
|
||||
@@ -263,13 +445,18 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
colors: _etaInfo != null
|
||||
? [
|
||||
_colorSegunETA(_etaInfo!.etaMinutos),
|
||||
_colorSegunETA(_etaInfo!.etaMinutos).withOpacity(0.7),
|
||||
_colorSegunETA(_etaInfo!.etaMinutos).withValues(alpha: 0.7),
|
||||
]
|
||||
: [const Color(0xFF2E7D32), const Color(0xFF1B5E20)],
|
||||
),
|
||||
),
|
||||
child: SafeArea(
|
||||
child: _buildContenido(),
|
||||
child: SingleChildScrollView(
|
||||
// 🚀 AGREGA ESTE WIDGET AQUÍ
|
||||
physics:
|
||||
const BouncingScrollPhysics(), // Da un efecto de rebote suave en Android
|
||||
child: _buildContenido(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -301,7 +488,8 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.wifi_off_rounded, size: 80, color: Colors.white54),
|
||||
const Icon(Icons.wifi_off_rounded,
|
||||
size: 80, color: Colors.white54),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
_error!,
|
||||
@@ -352,7 +540,8 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
// Colonia del usuario
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.location_on, color: Colors.white70, size: 18),
|
||||
const Icon(Icons.location_on,
|
||||
color: Colors.white70, size: 18),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
eta.colonia,
|
||||
@@ -364,17 +553,162 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
),
|
||||
],
|
||||
),
|
||||
// Botón de logout
|
||||
IconButton(
|
||||
onPressed: _cerrarSesion,
|
||||
icon: const Icon(Icons.logout, color: Colors.white70),
|
||||
tooltip: 'Cerrar sesión',
|
||||
Row(
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, '/routes');
|
||||
},
|
||||
icon: const Icon(Icons.list_alt, color: Colors.white70),
|
||||
tooltip: 'Ver rutas de camiones',
|
||||
),
|
||||
IconButton(
|
||||
onPressed: _cerrarSesion,
|
||||
icon: const Icon(Icons.logout, color: Colors.white70),
|
||||
tooltip: 'Cerrar sesión',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const Spacer(flex: 1),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
eta.rutaNombre,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Status: ${eta.rutaStatus}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white70,
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const Icon(Icons.local_shipping_rounded,
|
||||
color: Colors.white70, size: 24),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
if (!eta.gpsOk)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.shade700.withValues(alpha: 0.18),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(color: Colors.red.shade300),
|
||||
),
|
||||
child: const Row(
|
||||
children: [
|
||||
Icon(Icons.gps_off, color: Colors.white70),
|
||||
SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'Alerta: el GPS del camión no está reportando. Se enviará una notificación si el problema persiste.',
|
||||
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 16),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.14),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Direcciones registradas',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
if (_direcciones.isEmpty)
|
||||
const Text(
|
||||
'No tienes direcciones registradas aún. Agrega una para mejorar tu ETA.',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
)
|
||||
else
|
||||
for (final direccion in _direcciones)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
direccion.colonia,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 2),
|
||||
Text(
|
||||
direccion.direccion,
|
||||
style: const TextStyle(
|
||||
color: Colors.white70, fontSize: 13),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
ElevatedButton.icon(
|
||||
onPressed: _mostrarAgregarDireccionDialog,
|
||||
icon: const Icon(Icons.add_location_alt_outlined),
|
||||
label: const Text('Agregar dirección'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white.withValues(alpha: 0.18),
|
||||
foregroundColor: Colors.white,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 40),
|
||||
|
||||
// --------------------------------------------------------
|
||||
// CENTRO: ETA Visual (el corazón de la pantalla)
|
||||
@@ -387,7 +721,7 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
height: 220,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white.withOpacity(0.15),
|
||||
color: Colors.white.withValues(alpha: 0.15),
|
||||
border: Border.all(color: Colors.white, width: 3),
|
||||
),
|
||||
child: Column(
|
||||
@@ -455,7 +789,7 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
color: Colors.black.withValues(alpha: 0.2),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
@@ -479,7 +813,71 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
),
|
||||
),
|
||||
|
||||
const Spacer(flex: 2),
|
||||
const SizedBox(height: 24),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
||||
child: Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.15),
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Información relevante',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 12),
|
||||
Text(
|
||||
'• Separa orgánicos y reciclables. No mezcles líquidos con bolsas de plástico.',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'• Saca tu basura a la acera sólo cuando recibas la alerta de proximidad.',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'• Si el camión no se mueve o su GPS se desconecta, recibirás una alerta de seguimiento.',
|
||||
style: TextStyle(color: Colors.white70, fontSize: 14),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
|
||||
child: SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () {
|
||||
Navigator.pushNamed(context, '/routes');
|
||||
},
|
||||
icon: const Icon(Icons.local_shipping_rounded),
|
||||
label: const Text('Ver estado de rutas y simular avance'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.white,
|
||||
foregroundColor: Colors.green.shade900,
|
||||
padding: const EdgeInsets.symmetric(vertical: 14),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16)),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// ❌ AQUÍ ESTABA EL Spacer(flex: 2) QUE ROMPÍA LA UI
|
||||
// 🚀 LO REEMPLAZAMOS POR UN ESPACIADO FIJO Y SEGURO:
|
||||
const SizedBox(height: 32),
|
||||
|
||||
// --------------------------------------------------------
|
||||
// FOOTER: Botón de refresh manual + última actualización
|
||||
@@ -513,6 +911,6 @@ class _HomeScreenState extends State<HomeScreen>
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
); // Fin de la Column principal de _buildUIConDatos()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user