import 'package:cached_network_image/cached_network_image.dart'; import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/controller/home/event_info_controller.dart'; import 'package:dating_touchme_app/generated/assets.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; class EventInfo extends StatelessWidget { final String id; const EventInfo({super.key, required this.id}); @override Widget build(BuildContext context) { return GetX( init: EventInfoController(id: id), builder: (controller){ return controller.item.value.id != null ? Scaffold( appBar: const PageAppbar(title: "活动详情"), body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(15.w), child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(8.w)), child: Container( width: 345.w, color: Colors.white, child: Column( children: [ CachedNetworkImage( imageUrl: controller.item.value.imgList?[0].url ?? "", width: 345.w, fit: BoxFit.cover, errorWidget: (context, error, stackTrace) { return Image.asset( Assets.imagesBanner, width: 345.w, height: 150.w, fit: BoxFit.cover, ); }, ), Container( padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 15.w), margin: EdgeInsets.only(bottom: 15.w), child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( controller.item.value.name ?? "", style: TextStyle( fontSize: 18.w, color: const Color.fromRGBO(255, 66, 236, 1), fontWeight: FontWeight.w500 ), ), Row( children: [ Icon( Icons.group, color: const Color.fromRGBO(255, 66, 236, 1), size: 12.w, ), SizedBox(width: 5.w,), Text( "${(controller.item.value.manNumber ?? 0) + (controller.item.value.womanNumber ?? 0)}人已报名", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ) ], ), SizedBox(height: 5.w,), Row( children: [ Icon( Icons.access_time, color: const Color.fromRGBO(255, 66, 236, 1), size: 12.w, ), Text( "活动时间:", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "${controller.item.value.beginTime!.substring(5, controller.item.value.beginTime!.length - 3)}至${controller.item.value.endTime!.substring(5, controller.item.value.endTime!.length - 3)}", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), SizedBox(height: 5.w,), Row( children: [ Icon( Icons.location_on_outlined, color: const Color.fromRGBO(255, 66, 236, 1), size: 12.w, ), Text( "地址:", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "${controller.item.value.cityName ?? ""}${controller.item.value.districtName ?? ""}${controller.item.value.detailedAddress ?? ""}", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), SizedBox(height: 5.w,), Row( children: [ Icon( Icons.group_outlined, color: const Color.fromRGBO(255, 66, 236, 1), size: 12.w, ), Text( "人数:", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "男${controller.item.value.numberMan}人 女${controller.item.value.womanNumber}人", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), SizedBox(height: 5.w,), Row( children: [ Icon( Icons.currency_yen, color: const Color.fromRGBO(255, 66, 236, 1), size: 12.w, ), Text( "费用:", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "男:${controller.item.value.participationAllocationList![0].originalPrice}元/人", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), Row( children: [ Icon( Icons.currency_yen, color: const Color.fromRGBO(255, 66, 236, 0), size: 12.w, ), Text( "费用:", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 0) ), ), Text( "女:${controller.item.value.participationAllocationList![1].originalPrice}元/人", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ) ], ), SizedBox(height: 15.w,), Stack( children: [ ClipRRect( borderRadius: BorderRadius.all(Radius.circular(13.w)), child: Row( children: [ Expanded( child: Container( height: 13.w, color: const Color.fromRGBO(237, 245, 255, 1), ), ), Expanded( child: Container( height: 13.w, color: const Color.fromRGBO(255, 237, 255, 1), ), ), ], ), ), Positioned( child: Center( child: Transform( transform: Matrix4.skewX(0.6), child: Container(width: 20.w, height: 13.w, color: Colors.white,), ), ), ) ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ Text( "男", style: TextStyle( fontSize: 13.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "${(controller.item.value.manNumber ?? 0)}人", style: TextStyle( fontSize: 13.w, color: const Color.fromRGBO(237, 245, 255, 1), ), ), ], ), Row( children: [ Text( "女", style: TextStyle( fontSize: 13.w, color: const Color.fromRGBO(144, 144, 144, 1) ), ), Text( "${(controller.item.value.womanNumber ?? 0)}人", style: TextStyle( fontSize: 13.w, color: const Color.fromRGBO(255, 237, 255, 1), ), ), ], ), ], ), ], ), ), CachedNetworkImage( imageUrl: controller.item.value.contentPic ?? "", width: 345.w, fit: BoxFit.cover, ) ], ), ), ), ), ), ) : Container(); }, ); } }