完善工作台
This commit is contained in:
441
lib/pages/layout/home/home_view copy.dart
Normal file
441
lib/pages/layout/home/home_view copy.dart
Normal file
@@ -0,0 +1,441 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
||||
|
||||
import '../../../utils/utils.dart';
|
||||
import 'home_logic.dart';
|
||||
|
||||
class HomePage extends StatelessWidget {
|
||||
const HomePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final logic = Get.find<HomeLogic>();
|
||||
final state = Get.find<HomeLogic>().state;
|
||||
|
||||
double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
onPopInvoked: (_) {
|
||||
ToolFn().isExit();
|
||||
},
|
||||
child: Scaffold(
|
||||
body: Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
Image.asset(
|
||||
'assets/images/home-tab-normal-bg.png',
|
||||
fit: BoxFit.fitWidth,
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsets.only(top: statusBarHeight, left: 10, right: 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
child: Image.network(
|
||||
"https://pic.ziyuan.wang/user/guest/2023/12/微信图片_20231109211458_c1a41ab0fd7dd.jpg",
|
||||
width: 50.0,
|
||||
)),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"商家: GAGA酒吧",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
Text(
|
||||
"Huakk,欢迎回来!!!",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了核销按钮");
|
||||
},
|
||||
child: const Icon(
|
||||
Icons.qr_code_scanner,
|
||||
size: 32,
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 70,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list.map((item) {
|
||||
return Column(
|
||||
children: [
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
);
|
||||
}).toList()),
|
||||
// const SizedBox(
|
||||
// height: 10,
|
||||
// ),
|
||||
ListView(shrinkWrap: true, children: [
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
constraints: const BoxConstraints.tightFor(
|
||||
width: double.maxFinite,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blueAccent,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
child: Wrap(
|
||||
direction: Axis.horizontal,
|
||||
spacing: 25,
|
||||
runSpacing: 10,
|
||||
alignment: WrapAlignment.center,
|
||||
children: logic.list2.map((item) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
ToolFn.tips("点击了${item["title"]}");
|
||||
},
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item["value"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
Text(
|
||||
item["title"]!,
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 15,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList()),
|
||||
),
|
||||
]),
|
||||
],
|
||||
))
|
||||
],
|
||||
)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user