import 'package:flutter/material.dart'; import '../../features/settings/presentation/pages/settings_page.dart'; import '../router/chats_placeholder.dart'; class MainScreen extends StatefulWidget { static const String routeName = '/main'; const MainScreen({super.key}); @override State createState() => _MainScreenState(); } class _MainScreenState extends State { int _currentIndex = 0; @override Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: _currentIndex, children: const [ ChatsTab(), ContactsTab(), SettingsTab(), ], ), bottomNavigationBar: BottomNavigationBar( currentIndex: _currentIndex, onTap: (index) => setState(() => _currentIndex = index), type: BottomNavigationBarType.fixed, items: const [ BottomNavigationBarItem( icon: Icon(Icons.chat_bubble_outline), activeIcon: Icon(Icons.chat_bubble), label: 'Чаты', ), BottomNavigationBarItem( icon: Icon(Icons.contacts_outlined), activeIcon: Icon(Icons.contacts), label: 'Контакты', ), BottomNavigationBarItem( icon: Icon(Icons.settings_outlined), activeIcon: Icon(Icons.settings), label: 'Настройки', ), ], ), ); } } class ChatsTab extends StatelessWidget { const ChatsTab({super.key}); @override Widget build(BuildContext context) { return const ChatsPage(); } } class ContactsTab extends StatelessWidget { const ContactsTab({super.key}); @override Widget build(BuildContext context) { return const Center( child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(Icons.contacts_outlined, size: 64, color: Colors.grey), SizedBox(height: 16), Text('Контакты', style: TextStyle(fontSize: 18)), SizedBox(height: 8), Text('Функция в разработке', style: TextStyle(color: Colors.grey)), ], ), ); } } class SettingsTab extends StatelessWidget { const SettingsTab({super.key}); @override Widget build(BuildContext context) { return const SettingsPage(); } }