Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions lib/widgets/bottomNav_chithra.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import 'package:flutter/material.dart';

class BottomNavChithra extends StatefulWidget {
const BottomNavChithra({Key? key}) : super(key: key);

@override
State<BottomNavChithra> createState() => _BottomNavChithraState();
}

class _BottomNavChithraState extends State<BottomNavChithra> {
int _currentIndex = 0;

final List<Widget> _screens = [
const HomeScreen(),
const MenuScreen(),
const ProfileScreen(),
];

@override
Widget build(BuildContext context) {
return Scaffold(
body: _screens[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: _currentIndex,
onTap: (index) {
setState(() {
_currentIndex = index;
});
},
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.restaurant_menu),
label: 'Menu',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
),
],
),
);
}
}

/* -------- Placeholder Screens -------- */

class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Center(
child: Text(
'Home Screen',
style: TextStyle(fontSize: 22),
),
);
}
}

class MenuScreen extends StatelessWidget {
const MenuScreen({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Center(
child: Text(
'Menu Screen',
style: TextStyle(fontSize: 22),
),
);
}
}

class ProfileScreen extends StatelessWidget {
const ProfileScreen({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
return const Center(
child: Text(
'Profile Screen',
style: TextStyle(fontSize: 22),
),
);
}
}