From 2246f448a210ae81df132027481c67687821006e Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Thu, 23 May 2024 13:49:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=20=E8=80=83=E5=8B=A4=20?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=9A=84=E7=94=A8=E6=88=B7=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=A4=B4=E5=83=8F=E6=98=BE=E7=A4=BA=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkingInList/checkingInList_page.dart | 18 ++++++++++++++++-- .../checkingInStaffList_page.dart | 18 ++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart b/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart index 17e73087..2e80f194 100755 --- a/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart +++ b/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:date_format/date_format.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -409,10 +410,23 @@ class _CheckingInListPageState extends State { else ClipRRect( borderRadius: BorderRadius.circular(100.w), - child: Image.network( - headUrl, + child: CachedNetworkImage( width: 60.w, height: 60.w, + imageUrl: headUrl, + placeholder: (BuildContext context, String url) => + const SizedBox(), + errorWidget: + (BuildContext context, String url, Object error) => + Container( + color: const Color(0xffEBF4FF), + child: Center( + child: Text( + name!.substring(0, 2), + style: TextStyle( + fontSize: 22.sp, color: const Color(0xff7F9CF5)), + )), + ), ), ), SizedBox(width: 20.w), diff --git a/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart b/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart index 9f58f45e..b9d88109 100755 --- a/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart +++ b/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart @@ -1,3 +1,4 @@ +import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_slidable/flutter_slidable.dart'; @@ -154,10 +155,23 @@ class _CheckingInStaffListPageState extends State { else ClipRRect( borderRadius: BorderRadius.circular(100.w), - child: Image.network( - staffListItem.headurl!, + child: CachedNetworkImage( width: 60.w, height: 60.w, + imageUrl: staffListItem.headurl!, + placeholder: (BuildContext context, String url) => + const SizedBox(), + errorWidget: + (BuildContext context, String url, Object error) => + Container( + color: const Color(0xffEBF4FF), + child: Center( + child: Text( + staffListItem.staffName!.substring(0, 2), + style: TextStyle( + fontSize: 22.sp, color: const Color(0xff7F9CF5)), + )), + ), ), ), SizedBox(