47 lines
1.3 KiB
Dart
47 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomNavBar extends StatelessWidget {
|
|
final int selectedIndex;
|
|
final Function(int) onItemSelected;
|
|
|
|
const CustomNavBar({
|
|
super.key,
|
|
required this.selectedIndex,
|
|
required this.onItemSelected,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
// Usar NavigationBar (Material 3) ao invés de BottomNavigationBar
|
|
return NavigationBar(
|
|
selectedIndex: selectedIndex,
|
|
onDestinationSelected: onItemSelected,
|
|
backgroundColor: Theme.of(context).colorScheme.surface,
|
|
surfaceTintColor: Theme.of(context).colorScheme.surfaceTint,
|
|
elevation: 1,
|
|
height: 70,
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.home_outlined),
|
|
selectedIcon: Icon(Icons.home_filled),
|
|
label: 'Home',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.sports_soccer_outlined),
|
|
selectedIcon: Icon(Icons.sports_soccer),
|
|
label: 'Jogo',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.people_outline),
|
|
selectedIcon: Icon(Icons.people),
|
|
label: 'Equipas',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.insights_outlined),
|
|
selectedIcon: Icon(Icons.insights),
|
|
label: 'Status',
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |