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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
const AMapWidget map = AMapWidget( const AMapWidget map = AMapWidget(
///SDK ///SDK
privacyStatement: ConstConfig.amapPrivacyStatement, privacyStatement: ConstConfig.amapPrivacyStatement,
apiKey: ConstConfig.amapApiKeys, apiKey: ConstConfig.amapApiKeys,
); );
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
title: const Text("首页"), title: const Text(
actions: 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( body: Padding(
padding: const EdgeInsets.all(20), padding: const EdgeInsets.all(10),
child: Column( child: Column(
children: [buildTopWidget()], children: [buildTopWidget()],
), ),
@ -36,7 +46,14 @@ class _HomePageState extends State<HomePage> {
} }
Widget buildTopWidget() { 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: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -56,8 +73,7 @@ class _HomePageState extends State<HomePage> {
children: [ children: [
Switch( Switch(
value: enabled, value: enabled,
onChanged: (value) => onChanged: (value) => setState(() {
setState(() {
enabled = value; enabled = value;
}), }),
activeColor: Colors.red, 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(), physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
crossAxisCount: 3, crossAxisCount: 3,
@ -89,12 +105,14 @@ class _HomePageState extends State<HomePage> {
NumberBlock(title: "钱包(元)", number: "111"), NumberBlock(title: "钱包(元)", number: "111"),
NumberBlock(title: "总订单数", number: "111"), 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/tixian_ic.png"),
ImageBlock(title: "个人中心",imgUrl: "images/3.0x/gerenzhongxin_ic.png"), ImageBlock(
ImageBlock(title: "设置",imgUrl: "images/3.0x/shezhi_ic.png"), title: "个人中心", imgUrl: "images/3.0x/gerenzhongxin_ic.png"),
ImageBlock(title: "设置", imgUrl: "images/3.0x/shezhi_ic.png"),
], ],
),) ),
], ],
),
); );
} }
} }