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,65 +46,73 @@ class _HomePageState extends State<HomePage> {
} }
Widget buildTopWidget() { Widget buildTopWidget() {
return Column( return Container(
children: [ padding: const EdgeInsets.all(20),
Row( decoration: const BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, color: Colors.white,
children: [ borderRadius: BorderRadius.all(Radius.circular(5))),
const Row( child: Column(
children: [ mainAxisSize: MainAxisSize.min,
Text( mainAxisAlignment: MainAxisAlignment.spaceBetween,
"接单中", children: [
style: TextStyle( Row(
fontSize: 23, mainAxisAlignment: MainAxisAlignment.spaceBetween,
fontWeight: FontWeight.bold, children: [
color: Colors.black), const Row(
) children: [
], Text(
), "接单中",
Row( style: TextStyle(
children: [ fontSize: 23,
Switch( fontWeight: FontWeight.bold,
value: enabled, color: Colors.black),
onChanged: (value) => )
setState(() { ],
enabled = value; ),
}), Row(
activeColor: Colors.red, children: [
), Switch(
Container( value: enabled,
margin: const EdgeInsets.only(left: 10, right: 10), onChanged: (value) => setState(() {
width: 1, enabled = value;
height: 20, }),
color: Colors.grey, activeColor: Colors.red,
), ),
Column( Container(
children: [ margin: const EdgeInsets.only(left: 10, right: 10),
enabled width: 1,
? Image.asset("images/3.0x/order_receiving_star.png") height: 20,
: Image.asset("images/3.0x/order_receiving_end.png"), color: Colors.grey,
const Text("订单") ),
], Column(
) children: [
], enabled
) ? Image.asset("images/3.0x/order_receiving_star.png")
], : Image.asset("images/3.0x/order_receiving_end.png"),
), const Text("订单")
Padding(padding:const EdgeInsets.only(top:0), child: GridView.count( ],
physics: const NeverScrollableScrollPhysics(), )
shrinkWrap: true, ],
crossAxisCount: 3, )
childAspectRatio: 1.5, ],
children: const [ ),
NumberBlock(title: "钱包(元)", number: "111"), GridView.count(
NumberBlock(title: "总订单数", number: "111"), physics: const NeverScrollableScrollPhysics(),
NumberBlock(title: "总金额(元)", number: "111"), shrinkWrap: true,
ImageBlock(title: "提现",imgUrl: "images/3.0x/tixian_ic.png"), crossAxisCount: 3,
ImageBlock(title: "个人中心",imgUrl: "images/3.0x/gerenzhongxin_ic.png"), childAspectRatio: 1.5,
ImageBlock(title: "设置",imgUrl: "images/3.0x/shezhi_ic.png"), children: const [
], 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"),
],
),
],
),
); );
} }
} }