Fladder/lib/widgets/shared/status_card.dart
Rafael 5e882b2177
[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.
2024-10-13 18:10:25 +02:00

39 lines
1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class StatusCard extends ConsumerWidget {
final Color? color;
final bool useFittedBox;
final Widget child;
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: 40,
height: 33,
child: Card(
elevation: 10,
surfaceTintColor: color,
shadowColor: color != null ? Colors.transparent : null,
child: IconTheme(
data: IconThemeData(
color: color,
),
child: Center(
child: useFittedBox
? FittedBox(
fit: BoxFit.scaleDown,
child: child,
)
: child,
),
),
),
),
);
}
}