flutter购物商城搜索界面
这里数据是固定的,没有从后端获取,仅仅展示页面效果
import 'package:flutter/material.dart';
import 'package:flutterjdshop/services/ScreenAdapter.dart';
class SearchPage extends StatefulWidget {
SearchPage({Key? key}) : super(key: key);
@override
State<SearchPage> createState() => _SearchPaheState();
}
class _SearchPaheState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Container(
height: ScreenAdapter.higth(70),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.8),
borderRadius: BorderRadius.circular(30)),
child: TextField(
autofocus: true,
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(30),
borderSide: BorderSide.none)),
),
),
actions: [
InkWell(
child: Container(
height: ScreenAdapter.higth(70),
width: ScreenAdapter.width(80),
child: Row(
children: [
Text("搜索"),
],
),
),
onTap: () {},
)
],
),
body: Container(
padding: EdgeInsets.all(10),
child: ListView(
children: [
Container(
child: Text("热搜", style: Theme.of(context).textTheme.bodyText1),
),
Divider(),
Wrap(
children: [
Container(
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.9),
borderRadius: BorderRadius.circular(10)),
child: Text("女装"),
),
Container(
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.9),
borderRadius: BorderRadius.circular(10)),
child: Text("笔记本电脑"),
),
Container(
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.9),
borderRadius: BorderRadius.circular(10)),
child: Text("女装1111"),
),
Container(
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.9),
borderRadius: BorderRadius.circular(10)),
child: Text("女装1111"),
),
Container(
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
color: Color.fromRGBO(233, 233, 233, 0.9),
borderRadius: BorderRadius.circular(10)),
child: Text("11111"),
),
],
),
SizedBox(height: 10,),
Container(
child: Text(
"历史记录",
style: Theme.of(context).textTheme.bodyText1,
),
),
Divider(),
Column(
children: [
ListTile(
title: Text("女装"),
),
Divider(),
ListTile(
title: Text("女装"),
),
Divider(),
ListTile(
title: Text("女装"),
),
Divider(),
],
),
SizedBox(height: 100,),
InkWell(
onTap: () {
},
child: Container(
width: ScreenAdapter.higth(500),
height: ScreenAdapter.higth(64),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
border: Border.all(
color: Colors.black,
width: 1,
)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.delete),
Text("清空历史记录"),
],
),
),
)
],
),
),
);
}
}
|