Co-authored-by: Azareth-Tr <Azareth-Tr@users.noreply.github.com>
Co-authored-by: MENDOZA BALLARDO GAEL RICARDO <gael-meb123@users.noreply.github.com>

vistas
This commit is contained in:
shinra32
2026-05-23 00:45:34 -06:00
parent c58fa571aa
commit 3a3178eb3b
15 changed files with 527 additions and 4237 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,7 +12,7 @@ class AlertsScreen extends StatefulWidget {
class _AlertsScreenState extends State<AlertsScreen> {
// Alerta activa de ejemplo
final AlertaModel _alertaActiva = AlertaModel(
final AlertaModel? _alertaActiva = AlertaModel(
id: 'alerta-001',
tipo: TipoAlerta.cercana,
distanciaMetros: 180,
@@ -220,7 +220,7 @@ class _AlertaActivaCard extends StatelessWidget {
borderRadius: BorderRadius.circular(4),
child: LinearProgressIndicator(
value: progreso,
backgroundColor: AppTheme.primaryMid.withValues(alpha: 0.4),
backgroundColor: AppTheme.primaryMid.withOpacity(0.4),
valueColor: const AlwaysStoppedAnimation<Color>(AppTheme.primary),
minHeight: 7,
),

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,8 @@
import 'package:flutter/material.dart';
import '../theme/app_theme.dart';
import '../widgets/widgets.dart' as w;
import 'admin_screen.dart';
import 'driver_screen.dart';
import 'main_shell.dart';
enum UserRole { usuario, conductor, administrador }
class LoginScreen extends StatefulWidget {
const LoginScreen({super.key});
@@ -18,7 +14,6 @@ class _LoginScreenState extends State<LoginScreen> {
final _formKey = GlobalKey<FormState>();
final _emailCtrl = TextEditingController();
final _passCtrl = TextEditingController();
UserRole _selectedRole = UserRole.usuario;
bool _obscurePass = true;
bool _loading = false;
@@ -37,22 +32,11 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() => _loading = false);
Navigator.pushAndRemoveUntil(
context,
MaterialPageRoute(builder: (_) => _homeForRole()),
MaterialPageRoute(builder: (_) => const MainShell()),
(_) => false,
);
}
Widget _homeForRole() {
switch (_selectedRole) {
case UserRole.conductor:
return const DriverShell();
case UserRole.administrador:
return const AdminShell();
case UserRole.usuario:
return const MainShell();
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -135,37 +119,7 @@ class _LoginScreenState extends State<LoginScreen> {
setState(() => _obscurePass = !_obscurePass),
),
),
const SizedBox(height: 16),
DropdownButtonFormField<UserRole>(
initialValue: _selectedRole,
decoration: InputDecoration(
labelText: 'Tipo de usuario',
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(14),
),
contentPadding:
const EdgeInsets.symmetric(horizontal: 14, vertical: 16),
),
items: const [
DropdownMenuItem(
value: UserRole.usuario,
child: Text('Usuario'),
),
DropdownMenuItem(
value: UserRole.conductor,
child: Text('Conductor'),
),
DropdownMenuItem(
value: UserRole.administrador,
child: Text('Administrador'),
),
],
onChanged: (value) {
if (value != null) {
setState(() => _selectedRole = value);
}
},
),
const SizedBox(height: 10),
Align(
alignment: Alignment.centerRight,

View File

@@ -33,7 +33,7 @@ class _MapScreenState extends State<MapScreen> {
enServicio: true,
);
final HouseModel _casa = HouseModel(
final HouseModel _casa = const HouseModel(
id: 'casa-01',
calle: 'Av. Insurgentes 245',
colonia: 'Centro',
@@ -45,6 +45,7 @@ class _MapScreenState extends State<MapScreen> {
Set<Marker> _markers = {};
Set<Circle> _circles = {};
bool _mapLoaded = false;
Timer? _refreshTimer;
// Distancia simulada (metros)
@@ -91,8 +92,8 @@ class _MapScreenState extends State<MapScreen> {
circleId: const CircleId('radio-alerta'),
center: LatLng(_casa.latitud, _casa.longitud),
radius: _casa.radioAlertaMetros.toDouble(),
fillColor: AppTheme.blue.withValues(alpha: 0.08),
strokeColor: AppTheme.blue.withValues(alpha: 0.4),
fillColor: AppTheme.blue.withOpacity(0.08),
strokeColor: AppTheme.blue.withOpacity(0.4),
strokeWidth: 1,
),
};
@@ -135,6 +136,7 @@ class _MapScreenState extends State<MapScreen> {
mapType: MapType.normal,
onMapCreated: (c) {
_mapController.complete(c);
setState(() => _mapLoaded = true);
},
),
@@ -289,7 +291,7 @@ class _LiveBadgeState extends State<_LiveBadge>
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.activo
? AppTheme.primary.withValues(alpha: 0.5 + _anim.value * 0.5)
? AppTheme.primary.withOpacity(0.5 + _anim.value * 0.5)
: AppTheme.textSecondary,
),
),
@@ -356,7 +358,7 @@ class _ArrivalBar extends StatelessWidget {
borderRadius: BorderRadius.circular(4),
child: LinearProgressIndicator(
value: progreso,
backgroundColor: AppTheme.primaryMid.withValues(alpha: 0.4),
backgroundColor: AppTheme.primaryMid.withOpacity(0.4),
valueColor:
const AlwaysStoppedAnimation<Color>(AppTheme.primary),
minHeight: 6,

View File

@@ -111,7 +111,9 @@ class ProfileScreen extends StatelessWidget {
'RutaVerde v1.0.0\nServicio de Limpia · Celaya, Gto.',
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 12, color: AppTheme.textHint, height: 1.6),
fontSize: 12,
color: AppTheme.textHint,
height: 1.6),
),
),
@@ -140,8 +142,7 @@ class ProfileScreen extends StatelessWidget {
actions: [
TextButton(
onPressed: () => Navigator.pop(ctx),
style:
TextButton.styleFrom(foregroundColor: AppTheme.textSecondary),
style: TextButton.styleFrom(foregroundColor: AppTheme.textSecondary),
child: const Text('Cancelar'),
),
TextButton(

View File

@@ -67,7 +67,7 @@ class _SplashScreenState extends State<SplashScreen>
width: 90,
height: 90,
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.15),
color: Colors.white.withOpacity(0.15),
borderRadius:
BorderRadius.circular(AppTheme.radiusXl),
),
@@ -103,7 +103,7 @@ class _SplashScreenState extends State<SplashScreen>
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 15,
color: Colors.white.withValues(alpha: 0.82),
color: Colors.white.withOpacity(0.82),
height: 1.5,
),
),
@@ -189,7 +189,7 @@ class _SplashScreenState extends State<SplashScreen>
'Servicio de Limpia · Celaya, Gto.',
style: TextStyle(
fontSize: 12,
color: Colors.white.withValues(alpha: 0.45),
color: Colors.white.withOpacity(0.45),
),
),
@@ -214,9 +214,9 @@ class _FeatureChip extends StatelessWidget {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
decoration: BoxDecoration(
color: Colors.white.withValues(alpha: 0.12),
color: Colors.white.withOpacity(0.12),
borderRadius: BorderRadius.circular(AppTheme.radiusMd),
border: Border.all(color: Colors.white.withValues(alpha: 0.2)),
border: Border.all(color: Colors.white.withOpacity(0.2)),
),
child: Column(
children: [