[Bugfix] Fix poster child count clipping large numbers(#8)

Fix the error when display large numbers #5 

Example: 

![image](https://github.com/user-attachments/assets/78cfd283-680f-4d51-88e4-89a178d2e732)

The numbers in the example image was random generated.
This commit is contained in:
Rafael 2024-10-13 18:10:25 +02:00 committed by GitHub
parent 41ec72017c
commit 5e882b2177
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 6 deletions

View file

@ -3,16 +3,17 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
class StatusCard extends ConsumerWidget {
final Color? color;
final bool useFittedBox;
final Widget child;
const StatusCard({this.color, required this.child, super.key});
const StatusCard({this.color, this.useFittedBox = false, required this.child, super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
return Padding(
padding: const EdgeInsets.all(5),
child: SizedBox(
width: 33,
width: 40,
height: 33,
child: Card(
elevation: 10,
@ -22,7 +23,14 @@ class StatusCard extends ConsumerWidget {
data: IconThemeData(
color: color,
),
child: Center(child: child),
child: Center(
child: useFittedBox
? FittedBox(
fit: BoxFit.scaleDown,
child: child,
)
: child,
),
),
),
),