44 lines
1.2 KiB
Dart
44 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../../../../core/theme/design_tokens.dart';
|
|
import '../../../../shared/widgets/app_pressable.dart';
|
|
|
|
class HomeUnreadBadge extends StatelessWidget {
|
|
const HomeUnreadBadge({super.key, required this.count, required this.onTap});
|
|
|
|
final int count;
|
|
final VoidCallback onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return AppPressable(
|
|
onTap: onTap,
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: AppSpacing.md,
|
|
vertical: AppSpacing.sm,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: AppColors.blue600,
|
|
borderRadius: BorderRadius.circular(AppRadius.full),
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: AppColors.slate900.withValues(alpha: 0.18),
|
|
blurRadius: AppRadius.md,
|
|
offset: const Offset(0, AppSpacing.xs),
|
|
),
|
|
],
|
|
),
|
|
child: Text(
|
|
'有$count条新消息',
|
|
style: const TextStyle(
|
|
color: AppColors.white,
|
|
fontSize: 12,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|