mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
Slight regression I didn't notice. Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
39 lines
1,020 B
Dart
39 lines
1,020 B
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.square(
|
|
dimension: 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,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|