google preperation 1
This commit is contained in:
+29
-34
@@ -1,48 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../utils/translations.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
|
||||
class BottomNavBar extends StatelessWidget {
|
||||
final int selectedIndex;
|
||||
final Function(int) onItemTapped;
|
||||
final String selectedLanguage;
|
||||
final ValueChanged<int> onItemTapped;
|
||||
final List<BottomNavigationBarItem> items;
|
||||
|
||||
const BottomNavBar({
|
||||
super.key,
|
||||
required this.selectedIndex,
|
||||
required this.onItemTapped,
|
||||
required this.selectedLanguage,
|
||||
required this.items,
|
||||
});
|
||||
|
||||
String _t(String key) {
|
||||
return AppTranslations.translate(key, selectedLanguage);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SafeArea(
|
||||
child: SizedBox(
|
||||
height: 80,
|
||||
child: BottomNavigationBar(
|
||||
backgroundColor: Colors.grey[900],
|
||||
currentIndex: selectedIndex,
|
||||
onTap: onItemTapped,
|
||||
showSelectedLabels: true,
|
||||
showUnselectedLabels: true,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
selectedFontSize: 12,
|
||||
unselectedFontSize: 12,
|
||||
selectedItemColor: Colors.white,
|
||||
unselectedItemColor: Colors.white70,
|
||||
items: [
|
||||
BottomNavigationBarItem(icon: const Icon(Icons.book), label: _t("Book")),
|
||||
BottomNavigationBarItem(icon: const Icon(Icons.my_location), label: _t("Shooting")),
|
||||
BottomNavigationBarItem(icon: const Icon(Icons.camera_alt), label: _t("Camera")),
|
||||
BottomNavigationBarItem(icon: const Icon(Icons.calendar_today), label: _t("Calendar")),
|
||||
BottomNavigationBarItem(icon: const Icon(Icons.settings), label: _t("Settings")),
|
||||
],
|
||||
Widget build(BuildContext context) {
|
||||
// Paint the gesture-bar strip below the nav too (edge-to-edge since targetSdk 35),
|
||||
// otherwise the target background color shows through as a thin line.
|
||||
return ColoredBox(
|
||||
color: AppTheme.bar,
|
||||
child: SafeArea(
|
||||
top: false,
|
||||
child: SizedBox(
|
||||
height: 80,
|
||||
child: BottomNavigationBar(
|
||||
backgroundColor: AppTheme.bar,
|
||||
currentIndex: selectedIndex,
|
||||
onTap: onItemTapped,
|
||||
showSelectedLabels: true,
|
||||
showUnselectedLabels: true,
|
||||
type: BottomNavigationBarType.fixed,
|
||||
selectedFontSize: 12,
|
||||
unselectedFontSize: 12,
|
||||
selectedItemColor: Colors.white,
|
||||
unselectedItemColor: Colors.white70,
|
||||
items: items,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user