melhorar o navigation e o separar controlls e widgetes e pages
This commit is contained in:
47
lib/widgets/custom_nav_bar.dart
Normal file
47
lib/widgets/custom_nav_bar.dart
Normal file
@@ -0,0 +1,47 @@
|
||||
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',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user