diff --git a/lib/home.dart b/lib/home.dart index 25510b2..20bf802 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -1,14 +1,33 @@ import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/material.dart'; -import 'package:flutterfire_ui/auth.dart'; - -import 'home.dart'; class HomeScreen extends StatelessWidget { - const HomeScreen({super.key}); + const HomeScreen({super.key}); - @override - Widget build(BuildContext context) { + @override + Widget build(BuildContext context) { + return const StatefulHome(); + } +} + +class StatefulHome extends StatefulWidget { + const StatefulHome({super.key}); + + @override + State createState() => _StatefulHomeState(); +} + +class _StatefulHomeState extends State { + int _selectedIndex = 0; + + void _onItemTapped(int index) { + setState(() { + _selectedIndex = index; + }); + } + + @override + Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('FlutterFire UI'), @@ -27,6 +46,32 @@ class HomeScreen extends StatelessWidget { ], ), ), + bottomNavigationBar: BottomNavigationBar( + type: BottomNavigationBarType.fixed, + backgroundColor: Colors.red, + selectedItemColor: Colors.black, + unselectedItemColor: Colors.black54, + items: const [ + BottomNavigationBarItem( + icon: Icon(Icons.shopping_cart), + label: 'Buy', + ), + BottomNavigationBarItem( + icon: Icon(Icons.attach_money), + label: 'Sell', + ), + BottomNavigationBarItem( + icon: Icon(Icons.person), + label: 'Profile', + ), + BottomNavigationBarItem( + icon: Icon(Icons.settings), + label: 'Settings', + ), + ], + currentIndex: _selectedIndex, + onTap: _onItemTapped, + ), ); - } -} \ No newline at end of file + } +}