This commit is contained in:
2024-01-04 16:41:51 +08:00
parent 55085ee563
commit 47f82097e2
22 changed files with 483 additions and 645 deletions

View File

@@ -0,0 +1,46 @@
import 'package:get/get.dart';
import 'data_count_state.dart';
class DataCountLogic extends GetxController {
final DataCountState state = DataCountState();
final List<Map<String, String>> list = [
{
"title": "今日成交额",
"value": "100000",
},
{
"title": "昨日成交额",
"value": "2000",
},
{
"title": "本月成交额",
"value": "10000",
},
{
"title": "今日订单数",
"value": "100",
},
{
"title": "昨日订单数",
"value": "200",
},
{
"title": "本月订单数",
"value": "5000",
},
];
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@@ -0,0 +1,5 @@
class DataCountState {
DataCountState() {
///Initialize variables
}
}

View File

@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'data_count_logic.dart';
class DataCountComponent extends StatelessWidget {
const DataCountComponent({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final logic = Get.put(DataCountLogic());
final state = Get.find<DataCountLogic>().state;
return Wrap(
direction: Axis.horizontal,
spacing: 55,
runSpacing: 15,
alignment: WrapAlignment.center,
children: logic.list.map((item) {
return Column(
children: [
Text(
item["title"]!,
style: const TextStyle(
color: Colors.grey,
fontSize: 16,
),
),
Text(
item["value"]!,
style: const TextStyle(
color: Colors.black,
fontSize: 19,
fontWeight: FontWeight.bold),
),
],
);
}).toList());
}
}

View File

@@ -0,0 +1,5 @@
library data_count_component;
export './data_count_logic.dart';
export './data_count_state.dart';
export './data_count_view.dart';