dth-pingpong-mobileapp/lib/navbar.dart

45 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
class BottomNavigationBarCustom extends StatelessWidget {
final int currentIndex;
final Function(int) onTap;
const BottomNavigationBarCustom({
Key? key,
required this.currentIndex,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
currentIndex: currentIndex,
onTap: onTap,
selectedItemColor: Colors.blue,
unselectedItemColor: Colors.grey,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.leaderboard),
label: 'Leaderboard',
),
BottomNavigationBarItem(
icon: Icon(Icons.join_full_outlined),
label: 'Join a Match',
),
BottomNavigationBarItem(
icon: Icon(Icons.add),
label: 'Create Match',
),
BottomNavigationBarItem(
icon: Icon(Icons.group),
label: 'Friends',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Me',
),
],
);
}
}