mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
27 lines
687 B
Dart
27 lines
687 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class UnreadBadge extends StatelessWidget {
|
|
final int count;
|
|
|
|
const UnreadBadge({super.key, required this.count});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final display = count > 9999 ? '9999+' : count.toString();
|
|
return Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
|
|
decoration: BoxDecoration(
|
|
color: Colors.redAccent,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Text(
|
|
display,
|
|
style: const TextStyle(
|
|
color: Colors.white,
|
|
fontSize: 11,
|
|
fontWeight: FontWeight.w600,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|