import 'package:flutter/material.dart'; class CustomNavigationRail extends StatefulWidget { const CustomNavigationRail({super.key, required selectedIndex}); @override State createState() => Custom_NavigationRailState(); } class Custom_NavigationRailState extends State { int selectedIndex = 0; @override Widget build(BuildContext context) { return NavigationRail( backgroundColor: Color.fromARGB(255, 25, 30, 41), selectedIndex: selectedIndex, onDestinationSelected: (int index) { setState(() { selectedIndex = index; }); }, labelType: NavigationRailLabelType.all, destinations: const [ NavigationRailDestination( icon: Icon(Icons.home, color: Colors.white), selectedIcon: Icon(Icons.home_filled), label: Text('Inicio'), ), NavigationRailDestination( icon: Icon(Icons.search), selectedIcon: Icon( Icons.search_rounded, color: Colors.white, ), label: Text('Buscar'), ), NavigationRailDestination( icon: Icon(Icons.settings), selectedIcon: Icon(Icons.settings_rounded, color: Colors.white), label: Text('Ajustes'), ), ], ); } }