75 lines
2.1 KiB
Dart
75 lines
2.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../core/theme.dart';
|
|
|
|
class AttendanceTimeCard extends StatelessWidget {
|
|
final String jamMasuk;
|
|
final String jamPulang;
|
|
final String totalJam;
|
|
|
|
const AttendanceTimeCard({
|
|
Key? key,
|
|
required this.jamMasuk,
|
|
required this.jamPulang,
|
|
required this.totalJam,
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Row(
|
|
children: [
|
|
Expanded(child: _buildTimeRow("Total Jam", totalJam, AppTheme.primaryDark)),
|
|
const SizedBox(width: 8),
|
|
Expanded(child: _buildTimeRow("Datang", jamMasuk, AppTheme.statusGreen)),
|
|
const SizedBox(width: 8),
|
|
Expanded(child: _buildTimeRow("Pulang", jamPulang, AppTheme.statusRed)),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildTimeRow(String label, String time, Color accentColor) {
|
|
return Container(
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
color: AppTheme.bgCard,
|
|
borderRadius: BorderRadius.circular(AppTheme.radiusSm),
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Container(
|
|
width: 4,
|
|
height: 20,
|
|
decoration: BoxDecoration(
|
|
color: accentColor,
|
|
borderRadius: BorderRadius.circular(2),
|
|
),
|
|
),
|
|
const SizedBox(width: 8),
|
|
Expanded(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: AppTheme.bodySmall.copyWith(
|
|
color: AppTheme.textSecondary,
|
|
fontSize: 10,
|
|
),
|
|
),
|
|
const SizedBox(height: 2),
|
|
FittedBox(
|
|
fit: BoxFit.scaleDown,
|
|
alignment: Alignment.centerLeft,
|
|
child: Text(
|
|
time,
|
|
style: AppTheme.labelLarge.copyWith(fontSize: 14),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|