import 'package:flutter/material.dart'; import '../../core/widgets/app_widgets.dart'; import '../eta/eta_screen.dart'; import '../alerts/alerts_screen.dart'; import 'house_screen.dart'; import '../profile/profile_screen.dart'; class MainShell extends StatefulWidget { const MainShell({super.key}); @override State createState() => _MainShellState(); } class _MainShellState extends State { int _currentIndex = 0; static const List _screens = [ EtaScreen(), AlertsScreen(), MyHouseScreen(), ProfileScreen(), ]; @override Widget build(BuildContext context) { return Scaffold( // Renderiza únicamente la pantalla activa para desmontar vistas nativas // (p. ej. FlutterMap) cuando la pestaña no está activa, evitando que // queden superpuestas sobre la UI de otras pestañas. body: _screens[_currentIndex], bottomNavigationBar: AppBottomNav( currentIndex: _currentIndex, onTap: (i) => setState(() => _currentIndex = i), ), ); } }