52 lines
1.4 KiB
Dart
52 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:food_hub_app/layout/app_actions.dart';
|
|
import 'package:food_hub_app/layout/app_drawer.dart';
|
|
import 'package:food_hub_app/layout/app_navbar.dart';
|
|
import 'package:food_hub_app/layout/menu.dart';
|
|
|
|
class HomePage extends StatefulWidget {
|
|
const HomePage({super.key});
|
|
|
|
@override
|
|
State<StatefulWidget> createState() => _HomePage();
|
|
}
|
|
|
|
class _HomePage extends State<HomePage> {
|
|
int _currentIndex = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
centerTitle: true,
|
|
title: Text('食光集', style: TextStyle(color: Colors.white)),
|
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
|
leading: Builder(
|
|
builder: (context) {
|
|
return IconButton(
|
|
icon: const Icon(Icons.menu),
|
|
color: Colors.white,
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
);
|
|
},
|
|
),
|
|
actions: [AppActions()],
|
|
),
|
|
// backgroundColor: Color(0xFFF5F5F5),
|
|
drawer: AppDrawer(),
|
|
body: Padding(
|
|
padding: EdgeInsets.all(10),
|
|
child: tabPages[_currentIndex],
|
|
),
|
|
bottomNavigationBar: AppNavbar(
|
|
currentPageIndex: _currentIndex,
|
|
onTapNavbarItem: (index) {
|
|
setState(() {
|
|
_currentIndex = index;
|
|
});
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|