MIF_E31230910_MP-HRIS-MOBILE/lib/widgets/molecules/info_row_card.dart

65 lines
1.7 KiB
Dart

import 'package:flutter/material.dart';
import '../../core/theme.dart';
class InfoRowCard extends StatelessWidget {
final IconData icon;
final Color iconColor;
final String label;
final String value;
final Color? valueColor;
final String? subtitle;
const InfoRowCard({
Key? key,
required this.icon,
required this.iconColor,
required this.label,
required this.value,
this.valueColor,
this.subtitle,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
Icon(icon, color: iconColor, size: 24),
const SizedBox(width: 14),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: AppTheme.bodySmall.copyWith(color: AppTheme.textSecondary),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 2),
FittedBox(
fit: BoxFit.scaleDown,
alignment: Alignment.centerLeft,
child: Text(
value,
style: AppTheme.heading3.copyWith(color: valueColor ?? AppTheme.textPrimary),
maxLines: 1,
),
),
if (subtitle != null)
Text(
subtitle!,
style: AppTheme.bodySmall.copyWith(
color: AppTheme.textSecondary,
fontSize: 10,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
),
],
);
}
}