You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
meshcore-client/lib/widgets/unread_badge.dart

31 lines
696 B

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 > 99 ? '99+' : 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,
),
),
);
}
}

Powered by TurnKey Linux.