|
@@ -1,90 +1,9 @@
|
|
-import 'package:canteen/ui/food_list_page.dart';
|
|
|
|
-import 'package:canteen/widget/chzn_expansion_panel_list.dart';
|
|
|
|
|
|
+import 'package:canteen/views/chzn_expansion_panel_list.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
-class HomePage extends StatefulWidget {
|
|
|
|
- const HomePage({Key? key}) : super(key: key);
|
|
|
|
-
|
|
|
|
- @override
|
|
|
|
- State<HomePage> createState() => HomePageState();
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-class HomePageState extends State<HomePage> {
|
|
|
|
- @override
|
|
|
|
- Widget build(BuildContext context) {
|
|
|
|
- return Scaffold(
|
|
|
|
- /// 标题栏
|
|
|
|
- appBar: AppBar(
|
|
|
|
- title: const Text("食堂菜谱"),
|
|
|
|
- leading: Builder(
|
|
|
|
- builder: (context) {
|
|
|
|
- ///返回按钮
|
|
|
|
- return IconButton(
|
|
|
|
- icon: const Icon(Icons.arrow_back, color: Colors.white),
|
|
|
|
- onPressed: () {
|
|
|
|
- Navigator.pop(context);
|
|
|
|
- },
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- body: Container(
|
|
|
|
- color: Colors.white,
|
|
|
|
- child: Column(
|
|
|
|
- children: [
|
|
|
|
- /// 输入框栏
|
|
|
|
- Row(children: [
|
|
|
|
- Expanded(
|
|
|
|
- child: Container(
|
|
|
|
- margin: const EdgeInsets.fromLTRB(15, 10, 15, 10),
|
|
|
|
- padding: const EdgeInsets.fromLTRB(15, 0, 0, 0),
|
|
|
|
- child: TextField(
|
|
|
|
- decoration: InputDecoration(
|
|
|
|
- hintText: "请输入查询内容",
|
|
|
|
- prefixIcon: Row(children: [
|
|
|
|
- Icon(Icons.search,
|
|
|
|
- color: Theme.of(context).primaryColor),
|
|
|
|
- Icon(Icons.keyboard_arrow_down,
|
|
|
|
- color: Theme.of(context).primaryColor)
|
|
|
|
- ]),
|
|
|
|
- border: InputBorder.none),
|
|
|
|
- focusNode: () {
|
|
|
|
- var focusNode = FocusNode();
|
|
|
|
- focusNode.addListener(() {
|
|
|
|
- if (focusNode.hasFocus) {
|
|
|
|
- focusNode.unfocus();
|
|
|
|
- //跳转至搜索页面
|
|
|
|
- // Navigator.push(context, route);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- return focusNode;
|
|
|
|
- }(),
|
|
|
|
- ),
|
|
|
|
- decoration: const BoxDecoration(
|
|
|
|
- color: Color(0xFFF0F0F0),
|
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(1e18)),
|
|
|
|
- ),
|
|
|
|
- )),
|
|
|
|
- IconButton(
|
|
|
|
- icon: Icon(Icons.star_border,
|
|
|
|
- color: Theme.of(context).primaryColor),
|
|
|
|
- onPressed: () {
|
|
|
|
- //此处应当跳转至收藏页面
|
|
|
|
- Navigator.of(context)
|
|
|
|
- .push(MaterialPageRoute(builder: (context) {
|
|
|
|
- return FoodListPage();
|
|
|
|
- }));
|
|
|
|
- },
|
|
|
|
- )
|
|
|
|
- ]),
|
|
|
|
- CampusListView()
|
|
|
|
- ],
|
|
|
|
- ),
|
|
|
|
- ),
|
|
|
|
- );
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
|
|
+/// Description: 首页-校区列表
|
|
|
|
+/// Time : 07/25/2022 Monday
|
|
|
|
+/// Author : liuyuqi.gov@msn.cn
|
|
class CampusListView extends StatefulWidget {
|
|
class CampusListView extends StatefulWidget {
|
|
static const campus = ["中心", "软件园", "洪家楼", "趵突泉", "千佛山", "兴隆山", "青岛", "威海"];
|
|
static const campus = ["中心", "软件园", "洪家楼", "趵突泉", "千佛山", "兴隆山", "青岛", "威海"];
|
|
static const campusImage = [
|
|
static const campusImage = [
|