사용하지 않는 파일 정리 전 백업 (Phase 10 완료 후 상태)
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/core/extensions/license_expiry_summary_extensions.dart';
|
||||
import 'package:superport/data/models/dashboard/license_expiry_summary.dart';
|
||||
|
||||
/// 라이선스 만료 알림 배너 위젯
|
||||
/// 라이선스 만료 알림 배너 위젯 (ShadCN UI)
|
||||
class LicenseExpiryAlert extends StatelessWidget {
|
||||
final LicenseExpirySummary summary;
|
||||
|
||||
@@ -18,74 +19,67 @@ class LicenseExpiryAlert extends StatelessWidget {
|
||||
return const SizedBox.shrink(); // 알림이 필요없으면 숨김
|
||||
}
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(
|
||||
color: _getAlertBackgroundColor(summary.alertLevel),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
border: Border.all(
|
||||
color: _getAlertBorderColor(summary.alertLevel),
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => _navigateToLicenses(context),
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
_getAlertIcon(summary.alertLevel),
|
||||
color: _getAlertIconColor(summary.alertLevel),
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
return GestureDetector(
|
||||
onTap: () => _navigateToLicenses(context),
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(16.0),
|
||||
child: ShadCard(
|
||||
backgroundColor: _getAlertBackgroundColor(summary.alertLevel),
|
||||
border: Border.all(
|
||||
color: _getAlertBorderColor(summary.alertLevel),
|
||||
width: 1.0,
|
||||
),
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(
|
||||
_getAlertIcon(summary.alertLevel),
|
||||
color: _getAlertIconColor(summary.alertLevel),
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
_getAlertTitle(summary.alertLevel),
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: _getAlertTextColor(summary.alertLevel),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
summary.alertMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: _getAlertTextColor(summary.alertLevel).withValues(alpha: 0.8 * 255),
|
||||
),
|
||||
),
|
||||
if (summary.alertLevel > 1) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_getAlertTitle(summary.alertLevel),
|
||||
'상세 내용을 확인하려면 탭하세요',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: _getAlertTextColor(summary.alertLevel),
|
||||
fontSize: 12,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: _getAlertTextColor(summary.alertLevel).withValues(alpha: 0.6 * 255),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
summary.alertMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: _getAlertTextColor(summary.alertLevel).withOpacity(0.8),
|
||||
),
|
||||
),
|
||||
if (summary.alertLevel > 1) ...[
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'상세 내용을 확인하려면 탭하세요',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontStyle: FontStyle.italic,
|
||||
color: _getAlertTextColor(summary.alertLevel).withOpacity(0.6),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
_buildStatsBadges(),
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: _getAlertTextColor(summary.alertLevel).withOpacity(0.6),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildStatsBadges(),
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
size: 16,
|
||||
color: _getAlertTextColor(summary.alertLevel).withValues(alpha: 0.6 * 255),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -97,39 +91,45 @@ class LicenseExpiryAlert extends StatelessWidget {
|
||||
return Row(
|
||||
children: [
|
||||
if (summary.expired > 0)
|
||||
_buildBadge('만료 ${summary.expired}', Colors.red),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: ShadBadge(
|
||||
backgroundColor: Colors.red.shade100,
|
||||
child: Text(
|
||||
'만료 ${summary.expired}',
|
||||
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (summary.expiring7Days > 0)
|
||||
_buildBadge('7일 ${summary.expiring7Days}', Colors.orange),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: ShadBadge(
|
||||
backgroundColor: Colors.orange.shade100,
|
||||
child: Text(
|
||||
'7일 ${summary.expiring7Days}',
|
||||
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (summary.expiring30Days > 0)
|
||||
_buildBadge('30일 ${summary.expiring30Days}', Colors.yellow[700]!),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 4),
|
||||
child: ShadBadge(
|
||||
backgroundColor: Colors.yellow.shade100,
|
||||
child: Text(
|
||||
'30일 ${summary.expiring30Days}',
|
||||
style: const TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// 개별 배지 생성
|
||||
Widget _buildBadge(String text, Color color) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(left: 4),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(color: color.withOpacity(0.5)),
|
||||
),
|
||||
child: Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.black87,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 라이선스 화면으로 이동
|
||||
/// 유지보수 일정 화면으로 이동
|
||||
void _navigateToLicenses(BuildContext context) {
|
||||
Navigator.pushNamed(context, Routes.licenses);
|
||||
Navigator.pushNamed(context, Routes.maintenanceSchedule);
|
||||
}
|
||||
|
||||
/// 알림 레벨별 배경색
|
||||
@@ -185,10 +185,10 @@ class LicenseExpiryAlert extends StatelessWidget {
|
||||
/// 알림 레벨별 타이틀
|
||||
String _getAlertTitle(int level) {
|
||||
switch (level) {
|
||||
case 3: return '라이선스 만료 위험';
|
||||
case 2: return '라이선스 만료 경고';
|
||||
case 1: return '라이선스 만료 주의';
|
||||
default: return '라이선스 정상';
|
||||
case 3: return '유지보수 만료 위험';
|
||||
case 2: return '유지보수 만료 경고';
|
||||
case 1: return '유지보수 만료 주의';
|
||||
default: return '유지보수 정상';
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user