75 lines
2.1 KiB
Dart
75 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../../core/constants/app_constants.dart';
|
|
|
|
/// Reusable operation card widget
|
|
/// Large, tappable card with icon and text for operation selection
|
|
class OperationCard extends StatelessWidget {
|
|
final String title;
|
|
final IconData icon;
|
|
final VoidCallback onTap;
|
|
final Color? backgroundColor;
|
|
final Color? iconColor;
|
|
|
|
const OperationCard({
|
|
super.key,
|
|
required this.title,
|
|
required this.icon,
|
|
required this.onTap,
|
|
this.backgroundColor,
|
|
this.iconColor,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
final colorScheme = theme.colorScheme;
|
|
|
|
return Card(
|
|
elevation: 2,
|
|
margin: const EdgeInsets.symmetric(
|
|
horizontal: AppConstants.defaultPadding,
|
|
vertical: AppConstants.smallPadding,
|
|
),
|
|
child: InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(AppConstants.borderRadius),
|
|
child: Container(
|
|
padding: const EdgeInsets.all(AppConstants.largePadding),
|
|
height: 180,
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
// Icon container with background
|
|
Container(
|
|
width: 80,
|
|
height: 80,
|
|
decoration: BoxDecoration(
|
|
color: backgroundColor ??
|
|
colorScheme.primaryContainer.withValues(alpha: 0.3),
|
|
shape: BoxShape.circle,
|
|
),
|
|
child: Icon(
|
|
icon,
|
|
size: 48,
|
|
color: iconColor ?? colorScheme.primary,
|
|
),
|
|
),
|
|
const SizedBox(height: AppConstants.defaultPadding),
|
|
|
|
// Title
|
|
Text(
|
|
title,
|
|
style: theme.textTheme.titleLarge?.copyWith(
|
|
fontWeight: FontWeight.bold,
|
|
color: colorScheme.onSurface,
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|