import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../bloc/app_bloc.dart'; import '../bloc/app_event.dart'; import '../models/models.dart'; class BottomNav extends StatelessWidget { final AppScreen currentScreen; const BottomNav({super.key, required this.currentScreen}); @override Widget build(BuildContext context) { final navItems = [ (id: AppScreen.library, label: 'Полка', icon: Icons.menu_book), (id: AppScreen.categories, label: 'Категории', icon: Icons.category), (id: AppScreen.wishlist, label: 'Вишлист', icon: Icons.bookmark), (id: AppScreen.settings, label: 'Настройки', icon: Icons.settings), ]; return Container( decoration: BoxDecoration( color: Colors.black.withValues(alpha: 0.85), border: Border( top: BorderSide(color: Colors.white.withValues(alpha: 0.05), width: 1), ), ), child: SafeArea( child: SizedBox( height: 64, child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: navItems.map((item) { final isSelected = currentScreen == item.id; return Expanded( child: GestureDetector( onTap: () { context.read().add(ScreenChanged(item.id)); }, child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( item.icon, color: isSelected ? const Color(0xFF17CF54) : Colors.grey.withValues(alpha: 0.6), size: 24, ), const SizedBox(height: 2), Text( item.label, style: TextStyle( fontSize: 10, fontWeight: FontWeight.w500, color: isSelected ? const Color(0xFF17CF54) : Colors.grey.withValues(alpha: 0.6), ), ), ], ), ), ); }).toList(), ), ), ), ); } }