ANDREAS_LATANOWSKY_CPD_1910877/lib/bottom_bar.dart

52 lines
1.2 KiB
Dart
Raw Normal View History

2023-11-21 19:48:58 +01:00
// ignore_for_file: library_private_types_in_public_api
2023-11-21 02:29:46 +01:00
import 'package:flutter/material.dart';
//might be useless. keep for now
class BottomBar extends StatefulWidget {
const BottomBar({Key? key}) : super(key: key);
@override
_BottomBarState createState() => _BottomBarState();
}
class _BottomBarState extends State<BottomBar> {
int _selectedIndex = 0;
2023-11-21 19:48:58 +01:00
// ignore: unused_field
2023-11-21 02:29:46 +01:00
static const List<Widget> _widgetOptions = <Widget>[
Text('Home Page'),
Text('todo'),
Text('pro'),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
return BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.business),
label: 'todo',
),
BottomNavigationBarItem(
icon: Icon(Icons.school),
label: 'pro',
),
],
currentIndex: _selectedIndex,
selectedItemColor: Colors.amber[800],
onTap: _onItemTapped,
);
}
}