From 0acbfd595eca23ea3c89ca8a28def1b08268e871 Mon Sep 17 00:00:00 2001 From: datang Date: Wed, 18 May 2022 18:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E8=AE=BE=E5=A4=87=E9=A2=84=E7=BA=A6?= =?UTF-8?q?=E6=97=B6=E6=AE=B5=E5=89=8D30=E5=88=86=E9=92=9F=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=89=AB=E7=A0=81=E6=94=B9=E4=B8=BA=E6=97=B6=E6=AE=B5?= =?UTF-8?q?=E5=89=8D=E5=90=8E30=E5=88=86=E9=92=9F=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E6=89=AB=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../facility/facility_appointment_card.dart | 2 +- .../facility/facility_type_detail_card.dart | 44 +++++++++++++++++-- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/lib/ui/community/facility/facility_appointment_card.dart b/lib/ui/community/facility/facility_appointment_card.dart index 8b045a30..c026d268 100644 --- a/lib/ui/community/facility/facility_appointment_card.dart +++ b/lib/ui/community/facility/facility_appointment_card.dart @@ -60,7 +60,7 @@ class FacilityAppointmentCard extends StatelessWidget { if (model.reserveStartDt == null) button = SizedBox(); int diffTime = model.reserveStartDt!.difference(DateTime.now()).inMinutes; - bool inTime = diffTime >= 0 && diffTime <= 30; + bool inTime = diffTime >= -30 && diffTime <= 30; if (inTime) button = _FacilityButton( bold: true, diff --git a/lib/ui/community/facility/facility_type_detail_card.dart b/lib/ui/community/facility/facility_type_detail_card.dart index 6482a39a..f051b160 100644 --- a/lib/ui/community/facility/facility_type_detail_card.dart +++ b/lib/ui/community/facility/facility_type_detail_card.dart @@ -1,3 +1,5 @@ +import 'dart:ui'; + import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; @@ -35,8 +37,8 @@ class FacilityTypeDetailCard extends StatelessWidget { Material( borderRadius: BorderRadius.circular(10.w), clipBehavior: Clip.antiAliasWithSaveLayer, - child:BeeImageNetwork( - imgs: model.imgList??[], + child: BeeImageNetwork( + imgs: model.imgList ?? [], height: 150.h, width: 200.w, fit: BoxFit.cover, @@ -61,7 +63,7 @@ class FacilityTypeDetailCard extends StatelessWidget { ), ), 15.hb, - '${DateUtil.formatDate(model.openStartDT,format: 'HH:mm')}-${DateUtil.formatDate(model.openEndDT,format: 'HH:mm')} 开放' + '${DateUtil.formatDate(model.openStartDT, format: 'HH:mm')}-${DateUtil.formatDate(model.openEndDT, format: 'HH:mm')} 开放' .text .size(20.sp) .make(), @@ -75,14 +77,48 @@ class FacilityTypeDetailCard extends StatelessWidget { ), ], ), + 30.hb, + // Container( + // height: 30.h, + // width: double.infinity, + // decoration: BoxDecoration( + // border: Border.all( + // color: Color(0xFF979797), + // width: 3.w, + // ), + // ), + // child: CustomPaint( + // painter: MyPainter(), + // ), + // ) ], ), onPressed: () { Get.off(() => FacilityPreorderPage( - facilityModel: facilityModel, + facilityModel: facilityModel, typeModel: model, )); }, ); } } + +class MyPainter extends CustomPainter { + @override + void paint(Canvas canvas, Size size) { + Paint _paint = Paint() + ..color = Colors.redAccent + ..strokeWidth = 20; + + //平移之前 + canvas.drawPoints(PointMode.points, [Offset(0, 0)], _paint); + canvas.translate(200, 200); + //平移之后 + canvas.drawPoints(PointMode.points, [Offset(0, 0)], _paint); + } + + @override + bool shouldRepaint(covariant CustomPainter oldDelegate) { + throw UnimplementedError(); + } +}