refactor: UI 일관성 개선 및 회사 타입 배지 통일
- 회사 리스트 화면의 배지를 ShadcnBadge 컴포넌트로 통일 - 본사(Blue)와 지점(Purple) 색상 차별화로 시각적 구분 강화 - 고객사(Orange), 파트너사(Green) 색상 체계 개선 - 장비/라이선스 관리 화면과 동일한 배지 스타일 적용 - 불필요한 문서 파일 정리 - 라이선스 만료 요약 모델 업데이트 - 리스트 화면들의 페이지네이션 및 필터링 로직 개선 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:superport/screens/user/user_list_redesign.dart';
|
||||
import 'package:superport/screens/license/license_list_redesign.dart';
|
||||
import 'package:superport/screens/warehouse_location/warehouse_location_list_redesign.dart';
|
||||
import 'package:superport/services/auth_service.dart';
|
||||
import 'package:superport/services/dashboard_service.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/data/models/auth/auth_user.dart';
|
||||
|
||||
@@ -32,7 +33,9 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
late AnimationController _sidebarAnimationController;
|
||||
AuthUser? _currentUser;
|
||||
late final AuthService _authService;
|
||||
late final DashboardService _dashboardService;
|
||||
late Animation<double> _sidebarAnimation;
|
||||
int _expiringLicenseCount = 0; // 30일 내 만료 예정 라이선스 수
|
||||
|
||||
// 레이아웃 상수 (1920x1080 최적화)
|
||||
static const double _sidebarExpandedWidth = 260.0;
|
||||
@@ -46,7 +49,9 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
_currentRoute = widget.initialRoute;
|
||||
_setupAnimations();
|
||||
_authService = GetIt.instance<AuthService>();
|
||||
_dashboardService = GetIt.instance<DashboardService>();
|
||||
_loadCurrentUser();
|
||||
_loadLicenseExpirySummary();
|
||||
}
|
||||
|
||||
Future<void> _loadCurrentUser() async {
|
||||
@@ -57,6 +62,36 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _loadLicenseExpirySummary() async {
|
||||
try {
|
||||
print('[DEBUG] 라이선스 만료 정보 로드 시작...');
|
||||
final result = await _dashboardService.getLicenseExpirySummary();
|
||||
result.fold(
|
||||
(failure) {
|
||||
// 실패 시 0으로 유지
|
||||
print('[ERROR] 라이선스 만료 정보 로드 실패: $failure');
|
||||
},
|
||||
(summary) {
|
||||
print('[DEBUG] 라이선스 만료 정보 로드 성공!');
|
||||
print('[DEBUG] 30일 내 만료: ${summary.within30Days}개');
|
||||
print('[DEBUG] 60일 내 만료: ${summary.within60Days}개');
|
||||
print('[DEBUG] 90일 내 만료: ${summary.within90Days}개');
|
||||
print('[DEBUG] 이미 만료: ${summary.expired}개');
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_expiringLicenseCount = summary.within30Days;
|
||||
print('[DEBUG] 상태 업데이트 완료: $_expiringLicenseCount');
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
print('[ERROR] 라이선스 만료 정보 로드 중 예외 발생: $e');
|
||||
print('[ERROR] 스택 트레이스: ${StackTrace.current}');
|
||||
}
|
||||
}
|
||||
|
||||
void _setupAnimations() {
|
||||
_sidebarAnimationController = AnimationController(
|
||||
@@ -114,6 +149,10 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
setState(() {
|
||||
_currentRoute = route;
|
||||
});
|
||||
// 라이선스 화면으로 이동할 때 만료 정보 새로고침
|
||||
if (route == Routes.license) {
|
||||
_loadLicenseExpirySummary();
|
||||
}
|
||||
}
|
||||
|
||||
/// 사이드바 토글
|
||||
@@ -479,6 +518,7 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
currentRoute: _currentRoute,
|
||||
onRouteChanged: _navigateTo,
|
||||
collapsed: _sidebarCollapsed,
|
||||
expiringLicenseCount: _expiringLicenseCount,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -551,6 +591,7 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
onPressed: () {
|
||||
// 페이지 새로고침
|
||||
setState(() {});
|
||||
_loadLicenseExpirySummary(); // 라이선스 만료 정보도 새로고침
|
||||
},
|
||||
variant: ShadcnButtonVariant.ghost,
|
||||
size: ShadcnButtonSize.small,
|
||||
@@ -804,12 +845,14 @@ class SidebarMenuRedesign extends StatelessWidget {
|
||||
final String currentRoute;
|
||||
final Function(String) onRouteChanged;
|
||||
final bool collapsed;
|
||||
final int expiringLicenseCount;
|
||||
|
||||
const SidebarMenuRedesign({
|
||||
Key? key,
|
||||
required this.currentRoute,
|
||||
required this.onRouteChanged,
|
||||
required this.collapsed,
|
||||
required this.expiringLicenseCount,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@@ -884,7 +927,7 @@ class SidebarMenuRedesign extends StatelessWidget {
|
||||
title: '유지보수 관리',
|
||||
route: Routes.license,
|
||||
isActive: currentRoute == Routes.license,
|
||||
badge: '3', // 만료 임박 라이선스 수
|
||||
badge: expiringLicenseCount > 0 ? expiringLicenseCount.toString() : null,
|
||||
),
|
||||
|
||||
if (!collapsed) ...[
|
||||
@@ -1003,13 +1046,13 @@ class SidebarMenuRedesign extends StatelessWidget {
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.error,
|
||||
color: Colors.orange,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
child: Text(
|
||||
badge,
|
||||
style: ShadcnTheme.caption.copyWith(
|
||||
color: ShadcnTheme.errorForeground,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
@@ -1024,7 +1067,7 @@ class SidebarMenuRedesign extends StatelessWidget {
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.error,
|
||||
color: Colors.orange,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user