openshock-android/lib/bottom_bar.dart
Mercurio e3fc6acf32 Changed default behavior of bottom bar
Commit also includes:
- Initial implementation of shocker limits
- minor code cleanup
- version bump to 2.2

**Release 2.5 due very soon!**
2023-11-13 09:31:28 +01:00

39 lines
998 B
Dart

import 'package:flutter/material.dart';
class BottomBar extends StatelessWidget {
final int currentIndex;
final Function(int) onTap;
const BottomBar({
required this.currentIndex,
required this.onTap,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
currentIndex: currentIndex,
onTap: onTap,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings),
label: 'Settings',
),
BottomNavigationBarItem(
icon: Icon(Icons.list),
label: 'Logs',
),
],
selectedItemColor: const Color.fromARGB(255, 211, 187, 255),
unselectedItemColor: Theme.of(context).textTheme.bodySmall?.color,
showUnselectedLabels: true,
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.bold),
);
}
}