| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- import 'package:flutter/material.dart';
- import 'package:get/get.dart';
- import 'package:trackoffical_app/utils.dart';
- import '../../generated/assets.dart';
- import 'package:common_pub/prelude.dart';
- import '../../widget/common.dart';
- class ModelItem {
- int? iUserid;
- int? iMsgType;
- String? sTime;
- String? sColor;
- String? sName;
- String? sMsg;
- // IconData? iconData;
- ModelItem(this.iUserid, this.iMsgType, this.sTime, this.sColor, this.sName,
- this.sMsg);
- }
- // const String kSubTitle = "abcdefghijklmnopqrstuvwxyz-1234567890";
- List<ModelItem> itemDatas = <ModelItem>[
- ModelItem(1, 1, "2023.07.04 12:25:26", "red", "贾奕", "成功打点 A56"),
- ModelItem(2, 1, "2023.07.04 12:26:16", "red", "王正祥", "完成比赛"),
- ModelItem(3, 1, "2023.07.04 12:27:27", "red", "冯烁", "成功打点 A15"),
- ModelItem(4, 1, "2023.07.04 12:28:27", "red", "冯烁", "成功打点 A16"),
- ModelItem(5, 1, "2023.07.04 12:29:27", "red", "冯烁", "成功打点 A17"),
- ModelItem(6, 1, "2023.07.04 12:29:30", "red", "冯烁", "完成比赛"),
- ];
- class PaceView extends GetView {
- const PaceView({super.key});
- @override
- Widget build(BuildContext context) {
- // final PageTopController c = Get.find();
- return Container(
- // color: Colors.red,
- // alignment: Alignment.topCenter,
- width: context.width,
- height: 7.22.wp,
- // padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
- child: Row(
- children: [
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 20),
- child: Text("消息",
- style: TextStyle(fontSize: 1.39.wp, color: Colors.black)),
- ),
- Container(color: const Color(0xffc9c9c9), height: 4.86.wp, width: 1),
- Expanded(
- child: Container(
- // color: Colors.yellow,
- height: 6.wp,
- padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
- // margin: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
- child: wList(),
- ))
- ],
- ),
- );
- }
- Widget wList() {
- var msgCount = itemDatas.length;
- return msgCount > 0 ? ListView.builder(
- padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 0),
- itemCount: msgCount,
- itemBuilder: (BuildContext context, int index) {
- return SizedBox(
- height: 2.0.wp,
- child: Row(
- children: [
- Container(
- // color: Colors.red,
- padding: EdgeInsets.only(left: 1.wp, right: 0.5.wp),
- // alignment: Alignment.center,
- child: Icon(
- Icons.notifications_none,
- size: 1.2.wp,
- ),
- ),
- Container(
- // color: Colors.blue,
- // alignment: Alignment.center,
- child: wMsgItem(index),
- ),
- ],
- ),
- );
- },
- ) : Center(child: Text("当前无消息", style: TextStyle(fontSize: 1.25.wp)));
- }
- Widget wMsgItem(int index) {
- TextStyle textStyle = TextStyle(fontSize: 1.25.wp);
- return Row(
- children: [
- Text(itemDatas[index].sTime!, style: textStyle),
- SizedBox(width: 1.wp),
- wUserMark(itemDatas[index].iUserid!),
- SizedBox(width: 0.3.wp),
- Text(itemDatas[index].sName!, style: textStyle),
- SizedBox(width: 0.5.wp),
- Text(itemDatas[index].sMsg!, style: textStyle),
- ],
- );
- }
- }
|