feat: API 연동 개선 및 라이선스 모델 확장

- 라이선스 모델 전면 개편 (상세 필드 추가, 계산 필드 구현)
- API 응답 처리 개선 (HTTP 상태 코드 기반)
- 장비 출고 폼 컨트롤러 추가
- 회사 지점 정보 모델 추가
- 공통 데이터 모델 구조 추가
- 전체 서비스 레이어 API 호출 방식 통일
- UI 컴포넌트 마이너 개선
This commit is contained in:
JiWoong Sul
2025-07-25 01:22:15 +09:00
parent 8384423cf2
commit 71b7b7f40b
42 changed files with 1543 additions and 315 deletions

View File

@@ -35,6 +35,10 @@ class OverviewController extends ChangeNotifier {
EquipmentStatusDistribution? get equipmentStatus => _equipmentStatus;
List<ExpiringLicense> get expiringLicenses => _expiringLicenses;
// 추가 getter
int get totalCompanies => _overviewStats?.totalCompanies ?? 0;
int get totalUsers => _overviewStats?.totalUsers ?? 0;
bool get isLoading => _isLoadingStats || _isLoadingActivities ||
_isLoadingEquipmentStatus || _isLoadingLicenses;
@@ -55,6 +59,11 @@ class OverviewController extends ChangeNotifier {
]);
}
// 대시보드 데이터 로드 (loadData의 alias)
Future<void> loadDashboardData() async {
await loadData();
}
// 개별 데이터 로드 메서드
Future<void> _loadOverviewStats() async {
_isLoadingStats = true;

View File

@@ -1,4 +1,6 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
import 'package:superport/screens/common/theme_shadcn.dart';
import 'package:superport/screens/common/components/shadcn_components.dart';
import 'package:superport/screens/overview/controllers/overview_controller.dart';
@@ -123,13 +125,13 @@ class _OverviewScreenRedesignState extends State<OverviewScreenRedesign> {
),
_buildStatCard(
'입고 장비',
'${_controller.totalEquipmentIn}',
'${_controller.overviewStats?.availableEquipment ?? 0}',
Icons.inventory,
ShadcnTheme.success,
),
_buildStatCard(
'출고 장비',
'${_controller.totalEquipmentOut}',
'${_controller.overviewStats?.inUseEquipment ?? 0}',
Icons.local_shipping,
ShadcnTheme.warning,
),
@@ -390,7 +392,7 @@ class _OverviewScreenRedesignState extends State<OverviewScreenRedesign> {
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
color: color.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(6),
),
child: Icon(icon, color: color, size: 20),
@@ -398,7 +400,7 @@ class _OverviewScreenRedesignState extends State<OverviewScreenRedesign> {
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: ShadcnTheme.success.withOpacity(0.1),
color: ShadcnTheme.success.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(12),
),
child: Row(
@@ -474,7 +476,7 @@ class _OverviewScreenRedesignState extends State<OverviewScreenRedesign> {
Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
color: color.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(6),
),
child: Icon(