From da9152d36b680b76e0e9d50536dd4692baffe084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=B7=A5=E7=A8=8B=E5=B8=88?= Date: Thu, 20 Aug 2026 02:49:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(mobile-next):=20=E6=9C=AA=E8=AF=BB=E8=A7=92?= =?UTF-8?q?=E6=A0=87=E6=94=B9=E4=B8=BA=E6=9C=80=E5=B0=8F=2018=C3=9718?= =?UTF-8?q?=E3=80=81=E7=99=BD=E5=AD=97=2012=E3=80=81=E5=9C=86=E8=A7=92=209?= =?UTF-8?q?=20=E5=B9=B6=E5=8E=BB=E6=8E=89=E9=87=8D=E9=98=B4=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仅改 unread_count_view.dart。默认尺寸 18,数字 12,圆角 9;删除三层 BoxShadow。 Co-authored-by: Cursor Co-authored-by: multica-agent --- .../lib/src/widgets/unread_count_view.dart | 57 +++++++------------ 1 file changed, 19 insertions(+), 38 deletions(-) diff --git a/mobile-next/openim_common/lib/src/widgets/unread_count_view.dart b/mobile-next/openim_common/lib/src/widgets/unread_count_view.dart index 43ce09b..337cfc2 100644 --- a/mobile-next/openim_common/lib/src/widgets/unread_count_view.dart +++ b/mobile-next/openim_common/lib/src/widgets/unread_count_view.dart @@ -1,12 +1,11 @@ import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:openim_common/openim_common.dart'; class UnreadCountView extends StatelessWidget { const UnreadCountView({ Key? key, this.count = 0, - this.size = 13, + this.size = 18, this.margin, }) : super(key: key); final int count; @@ -20,43 +19,25 @@ class UnreadCountView extends StatelessWidget { child: Container( alignment: Alignment.center, margin: margin, - padding: count > 99 ? EdgeInsets.symmetric(horizontal: 4.w) : null, - constraints: BoxConstraints(maxHeight: size, minWidth: size), - decoration: _decoration, - child: _text, + padding: count > 99 ? const EdgeInsets.symmetric(horizontal: 4) : null, + constraints: BoxConstraints( + minWidth: size, + minHeight: size, + maxHeight: size, + ), + decoration: BoxDecoration( + color: Styles.c_FF381F, + borderRadius: BorderRadius.circular(9), + ), + child: Text( + '${count > 99 ? '99+' : count}', + style: const TextStyle( + fontSize: 12, + color: Color(0xFFFFFFFF), + ), + textAlign: TextAlign.center, + ), ), ); } - - Text get _text => Text( - '${count > 99 ? '99+' : count}', - style: TextStyle( - fontSize: 8.sp, - color: const Color(0xFFFFFFFF), - ), - textAlign: TextAlign.center, - ); - - Decoration get _decoration => BoxDecoration( - color: Styles.c_FF381F, - shape: count > 99 ? BoxShape.rectangle : BoxShape.circle, - borderRadius: count > 99 ? BorderRadius.circular(10.r) : null, - boxShadow: [ - BoxShadow( - color: const Color(0x26C61B4A), - offset: Offset(1.15.w, 1.15.h), - blurRadius: 57.58.r, - ), - BoxShadow( - color: const Color(0x1AC61B4A), - offset: Offset(2.3.w, 2.3.h), - blurRadius: 11.52.r, - ), - BoxShadow( - color: const Color(0x0DC61B4A), - offset: Offset(4.61.w, 4.61.h), - blurRadius: 17.28.r, - ), - ], - ); }