84 lines
2.5 KiB
Dart
84 lines
2.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:superport/screens/common/theme_tailwind.dart';
|
|
import 'package:superport/screens/common/layout_components.dart';
|
|
|
|
// 대시보드 통계 카드 그리드 위젯 (SRP, 재사용성)
|
|
class StatsGrid extends StatelessWidget {
|
|
final int totalCompanies;
|
|
final int totalUsers;
|
|
final int totalLicenses;
|
|
final int totalEquipmentIn;
|
|
final int totalEquipmentOut;
|
|
|
|
const StatsGrid({
|
|
super.key,
|
|
required this.totalCompanies,
|
|
required this.totalUsers,
|
|
required this.totalLicenses,
|
|
required this.totalEquipmentIn,
|
|
required this.totalEquipmentOut,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GridView.count(
|
|
crossAxisCount: 3,
|
|
crossAxisSpacing: 16,
|
|
mainAxisSpacing: 16,
|
|
shrinkWrap: true,
|
|
childAspectRatio: 2.5,
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
children: [
|
|
MetronicStatsCard(
|
|
title: '등록된 회사',
|
|
value: '$totalCompanies',
|
|
icon: Icons.business,
|
|
iconBackgroundColor: AppThemeTailwind.info,
|
|
showTrend: true,
|
|
trendPercentage: 2.5,
|
|
isPositiveTrend: true,
|
|
),
|
|
MetronicStatsCard(
|
|
title: '등록된 사용자',
|
|
value: '$totalUsers',
|
|
icon: Icons.person,
|
|
iconBackgroundColor: AppThemeTailwind.primary,
|
|
showTrend: true,
|
|
trendPercentage: 3.7,
|
|
isPositiveTrend: true,
|
|
),
|
|
MetronicStatsCard(
|
|
title: '유효 라이센스',
|
|
value: '$totalLicenses',
|
|
icon: Icons.vpn_key,
|
|
iconBackgroundColor: AppThemeTailwind.secondary,
|
|
),
|
|
MetronicStatsCard(
|
|
title: '총 장비 입고',
|
|
value: '$totalEquipmentIn',
|
|
icon: Icons.input,
|
|
iconBackgroundColor: AppThemeTailwind.success,
|
|
showTrend: true,
|
|
trendPercentage: 1.8,
|
|
isPositiveTrend: true,
|
|
),
|
|
MetronicStatsCard(
|
|
title: '총 장비 출고',
|
|
value: '$totalEquipmentOut',
|
|
icon: Icons.output,
|
|
iconBackgroundColor: AppThemeTailwind.warning,
|
|
),
|
|
MetronicStatsCard(
|
|
title: '현재 재고',
|
|
value: '${totalEquipmentIn - totalEquipmentOut}',
|
|
icon: Icons.inventory_2,
|
|
iconBackgroundColor: AppThemeTailwind.danger,
|
|
showTrend: true,
|
|
trendPercentage: 0.7,
|
|
isPositiveTrend: false,
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|