import 'package:cached_network_image/cached_network_image.dart'; import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/controller/message/connect_history_controller.dart'; import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:dating_touchme_app/model/mine/connect_history_data.dart'; import 'package:dating_touchme_app/pages/home/user_information_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; class ConnectHistoryPage extends StatelessWidget { const ConnectHistoryPage({super.key}); @override Widget build(BuildContext context) { return GetX( init: ConnectHistoryController(), builder: (controller){ return Scaffold( appBar: PageAppbar(title: "连线记录"), body: SingleChildScrollView( child: Container( padding: EdgeInsets.symmetric( horizontal: 15.w, vertical: 10.w ), child: Column( children: [ ...controller.historyList.map((e){ return ConnectItem(item: e,); }), ], ), ), ), ); }, ); } } class ConnectItem extends StatefulWidget { final Records item; const ConnectItem({super.key, required this.item}); @override State createState() => _ConnectItemState(); } class _ConnectItemState extends State { @override Widget build(BuildContext context) { return Container( margin: EdgeInsets.only(bottom: 40.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(51.w)), child: CachedNetworkImage( imageUrl: widget.item.anchorProfilePhoto ?? "", width: 51.w, height: 51.w, fit: BoxFit.cover, ), ).onTap((){ Get.to(() => UserInformationPage(miId: widget.item.anchorMiId ?? "",)); }), SizedBox(width: 5.w,), ClipRRect( borderRadius: BorderRadius.all(Radius.circular(51.w)), child: CachedNetworkImage( imageUrl: widget.item.dateObjectProfilePhoto ?? "", width: 51.w, height: 51.w, fit: BoxFit.cover, ), ).onTap((){ Get.to(() => UserInformationPage(miId: widget.item.dateObjectMiId ?? "",)); }), SizedBox(width: 10.w,), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "${widget.item.dateObjectNickName ?? ""}", style: TextStyle( fontSize: 13.w ), ), Text( "${widget.item.dateObjectCityName ?? ""} | ${widget.item.dateObjectAge ?? ""}岁", style: TextStyle( fontSize: 8.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ) ], ), Text( "${widget.item.createTime ?? ""}", style: TextStyle( fontSize: 8.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), ); } }