main
zhuce 2024-02-22 19:36:35 +08:00
parent c9ca6ac6e3
commit b53e42a43f
1 changed files with 82 additions and 64 deletions

View File

@ -17,18 +17,28 @@ class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
const AMapWidget map = AMapWidget(
///SDK
privacyStatement: ConstConfig.amapPrivacyStatement,
apiKey: ConstConfig.amapApiKeys,
);
return Scaffold(
appBar: AppBar(
title: const Text("首页"),
actions: const [Text("今日在线时长?小时")],
title: const Text(
"首页",
style: TextStyle(color: Colors.white),
),
actions: const [
Text("今日在线时长?小时", style: TextStyle(color: Colors.white))
],
flexibleSpace: Container(
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage("images/4.0x/home_top_bg.png"),
fit: BoxFit.cover)),
)),
backgroundColor: const Color(0xFFF3F3F3),
body: Padding(
padding: const EdgeInsets.all(20),
padding: const EdgeInsets.all(10),
child: Column(
children: [buildTopWidget()],
),
@ -36,7 +46,14 @@ class _HomePageState extends State<HomePage> {
}
Widget buildTopWidget() {
return Column(
return Container(
padding: const EdgeInsets.all(20),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5))),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -56,8 +73,7 @@ class _HomePageState extends State<HomePage> {
children: [
Switch(
value: enabled,
onChanged: (value) =>
setState(() {
onChanged: (value) => setState(() {
enabled = value;
}),
activeColor: Colors.red,
@ -80,7 +96,7 @@ class _HomePageState extends State<HomePage> {
)
],
),
Padding(padding:const EdgeInsets.only(top:0), child: GridView.count(
GridView.count(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
crossAxisCount: 3,
@ -89,12 +105,14 @@ class _HomePageState extends State<HomePage> {
NumberBlock(title: "钱包(元)", number: "111"),
NumberBlock(title: "总订单数", number: "111"),
NumberBlock(title: "总金额(元)", number: "111"),
ImageBlock(title: "提现",imgUrl: "images/3.0x/tixian_ic.png"),
ImageBlock(title: "个人中心",imgUrl: "images/3.0x/gerenzhongxin_ic.png"),
ImageBlock(title: "设置",imgUrl: "images/3.0x/shezhi_ic.png"),
ImageBlock(title: "提现", imgUrl: "images/3.0x/tixian_ic.png"),
ImageBlock(
title: "个人中心", imgUrl: "images/3.0x/gerenzhongxin_ic.png"),
ImageBlock(title: "设置", imgUrl: "images/3.0x/shezhi_ic.png"),
],
),)
),
],
),
);
}
}