dailykart-flutter-app/lib/main.dart

77 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import 'screens/about_page.dart';
import 'screens/b2b_page.dart';
import 'screens/contact_page.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Dailykart',
theme: ThemeData(
primarySwatch: Colors.green,
fontFamily: 'Roboto',
),
home: const HomeScreen(),
);
}
}
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _currentIndex = 0;
final List<Widget> _pages = [
AboutPage(),
const B2BPage(),
const ContactPage(),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Dailykart'),
backgroundColor: Colors.green[800],
),
body: _pages[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: _currentIndex,
onTap: (index) {
setState(() {
_currentIndex = index;
});
},
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.info_outline),
label: 'About',
),
BottomNavigationBarItem(
icon: Icon(Icons.business_center),
label: 'B2B',
),
BottomNavigationBarItem(
icon: Icon(Icons.contact_mail),
label: 'Contact',
),
],
selectedItemColor: Colors.green[800],
unselectedItemColor: Colors.grey,
backgroundColor: Colors.white,
),
);
}
}