fix(mobile-next): 未读角标改为最小 18×18、白字 12、圆角 9 并去掉重阴影

仅改 unread_count_view.dart。默认尺寸 18,数字 12,圆角 9;删除三层 BoxShadow。

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
编码工程师
2026-08-20 02:49:21 +08:00
co-authored by Cursor multica-agent
parent 5e098a5d32
commit da9152d36b
@@ -1,12 +1,11 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:openim_common/openim_common.dart'; import 'package:openim_common/openim_common.dart';
class UnreadCountView extends StatelessWidget { class UnreadCountView extends StatelessWidget {
const UnreadCountView({ const UnreadCountView({
Key? key, Key? key,
this.count = 0, this.count = 0,
this.size = 13, this.size = 18,
this.margin, this.margin,
}) : super(key: key); }) : super(key: key);
final int count; final int count;
@@ -20,43 +19,25 @@ class UnreadCountView extends StatelessWidget {
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: margin, margin: margin,
padding: count > 99 ? EdgeInsets.symmetric(horizontal: 4.w) : null, padding: count > 99 ? const EdgeInsets.symmetric(horizontal: 4) : null,
constraints: BoxConstraints(maxHeight: size, minWidth: size), constraints: BoxConstraints(
decoration: _decoration, minWidth: size,
child: _text, 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,
),
],
);
} }