123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- import 'package:canteen/pages/food_list_page.dart';
- import 'package:canteen/views/campus_listview.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();
-
-
- }
- });
- 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()
- ],
- ),
- ),
- );
- }
- }
|