Files
bookshelf/books_flutter/lib/widgets/bottom_nav.dart
2026-02-08 12:04:45 +06:00

56 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
class BottomNav extends StatelessWidget {
final int currentIndex;
final ValueChanged<int> onTap;
const BottomNav({super.key, required this.currentIndex, required this.onTap});
@override
Widget build(BuildContext context) {
final colorScheme = Theme.of(context).colorScheme;
return Container(
decoration: BoxDecoration(
color: colorScheme.surface,
border: Border(
top: BorderSide(color: colorScheme.outlineVariant, width: 1),
),
boxShadow: [
BoxShadow(
color: colorScheme.shadow,
blurRadius: 8,
offset: const Offset(0, -2),
),
],
),
child: BottomNavigationBar(
currentIndex: currentIndex,
onTap: onTap,
backgroundColor: Colors.transparent,
elevation: 0,
selectedItemColor: colorScheme.primary,
unselectedItemColor: colorScheme.onSurface.withValues(alpha: 0.6),
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.local_library),
label: 'Библиотека',
),
BottomNavigationBarItem(
icon: Icon(Icons.category),
label: 'Категории',
),
BottomNavigationBarItem(
icon: Icon(Icons.bookmark),
label: 'Избранное',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Настройки',
),
],
),
);
}
}