feat(ui): full‑width ShadTable across app; fix rent dialog width; correct equipment pagination
- ShadTable: ensure full-width via LayoutBuilder+ConstrainedBox minWidth - BaseListScreen: default data area padding = 0 for table edge-to-edge - Vendor/Model/User/Company/Inventory/Zipcode: set columnSpanExtent per column and add final filler column to absorb remaining width; pin date/status/actions widths; ensure date text is single-line - Equipment: unify card/border style; define fixed column widths + filler; increase checkbox column to 56px to avoid overflow - Rent list: migrate to ShadTable.list with fixed widths + filler column - Rent form dialog: prevent infinite width by bounding ShadProgress with SizedBox and remove Expanded from option rows; add safe selectedOptionBuilder - Admin list: fix const with non-const argument in table column extents - Services/Controller: remove hardcoded perPage=10; use BaseListController perPage; trust server meta (total/totalPages) in equipment pagination - widgets/shad_table: ConstrainedBox(minWidth=viewport) so table stretches Run: flutter analyze → 0 errors (warnings remain).
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
/// 자동완성 텍스트 필드 위젯
|
||||
///
|
||||
@@ -136,16 +137,10 @@ class _AutocompleteTextFieldState extends State<AutocompleteTextField> {
|
||||
right: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
color: ShadcnTheme.card,
|
||||
border: Border.all(color: ShadcnTheme.border),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withValues(alpha: 0.3),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
boxShadow: ShadcnTheme.shadowSm,
|
||||
),
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: ListView.builder(
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
/// 드롭다운 기능이 있는 재사용 가능한 TextFormField 위젯
|
||||
class CustomDropdownField extends StatefulWidget {
|
||||
@@ -59,21 +60,14 @@ class _CustomDropdownFieldState extends State<CustomDropdownField> {
|
||||
showWhenUnlinked: false,
|
||||
offset: const Offset(0, 45),
|
||||
child: Material(
|
||||
elevation: 4,
|
||||
elevation: 0,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
color: ShadcnTheme.card,
|
||||
border: Border.all(color: ShadcnTheme.border),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withValues(alpha: 0.3),
|
||||
spreadRadius: 1,
|
||||
blurRadius: 3,
|
||||
offset: const Offset(0, 1),
|
||||
),
|
||||
],
|
||||
boxShadow: ShadcnTheme.shadowSm,
|
||||
),
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: SingleChildScrollView(
|
||||
@@ -175,4 +169,4 @@ class _CustomDropdownFieldState extends State<CustomDropdownField> {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:superport/data/models/equipment_history_dto.dart';
|
||||
import 'package:superport/services/equipment_service.dart';
|
||||
import 'package:superport/core/errors/failures.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
/// 장비 이력을 표시하는 팝업 다이얼로그
|
||||
class EquipmentHistoryDialog extends StatefulWidget {
|
||||
@@ -190,17 +191,17 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
Color _getTransactionTypeColor(String? type) {
|
||||
switch (type) {
|
||||
case 'I':
|
||||
return Colors.green;
|
||||
return ShadcnTheme.equipmentIn;
|
||||
case 'O':
|
||||
return Colors.blue;
|
||||
return ShadcnTheme.equipmentOut;
|
||||
case 'R':
|
||||
return Colors.orange;
|
||||
return ShadcnTheme.equipmentRepair;
|
||||
case 'T':
|
||||
return Colors.teal;
|
||||
return ShadcnTheme.equipmentRent;
|
||||
case 'D':
|
||||
return Colors.red;
|
||||
return ShadcnTheme.destructive;
|
||||
default:
|
||||
return Colors.grey;
|
||||
return ShadcnTheme.secondary;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,16 +212,10 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: ShadcnTheme.card,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.grey.shade200),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.02),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
border: Border.all(color: ShadcnTheme.border),
|
||||
boxShadow: ShadcnTheme.shadowSm,
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
@@ -359,15 +354,9 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
minHeight: 400,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade50,
|
||||
color: ShadcnTheme.background,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withValues(alpha: 0.15),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
boxShadow: ShadcnTheme.shadowLg,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
@@ -375,13 +364,13 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: ShadcnTheme.card,
|
||||
borderRadius: const BorderRadius.only(
|
||||
topLeft: Radius.circular(12),
|
||||
topRight: Radius.circular(12),
|
||||
),
|
||||
border: Border(
|
||||
bottom: BorderSide(color: Colors.grey.shade200),
|
||||
bottom: BorderSide(color: ShadcnTheme.border),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -580,13 +569,13 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: ShadcnTheme.card,
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: Radius.circular(12),
|
||||
bottomRight: Radius.circular(12),
|
||||
),
|
||||
border: Border(
|
||||
top: BorderSide(color: Colors.grey.shade200),
|
||||
top: BorderSide(color: ShadcnTheme.border),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -628,4 +617,4 @@ class _EquipmentHistoryDialogState extends State<EquipmentHistoryDialog> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ class _EquipmentRestoreDialogState extends State<EquipmentRestoreDialog> {
|
||||
height: 16,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
color: Colors.white,
|
||||
color: ShadcnTheme.primaryForeground,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -207,4 +207,4 @@ Future<bool?> showEquipmentRestoreDialog(
|
||||
onRestored: onRestored,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/core/services/lookups_service.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
// 장비 상태에 따라 칩(Chip) 위젯을 반환하는 함수형 위젯
|
||||
class EquipmentStatusChip extends StatelessWidget {
|
||||
@@ -13,7 +14,7 @@ class EquipmentStatusChip extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
// 캐시된 상태 정보 조회 시도
|
||||
String statusText = status;
|
||||
Color backgroundColor = Colors.grey;
|
||||
Color backgroundColor = ShadcnTheme.secondary;
|
||||
|
||||
try {
|
||||
final lookupsService = GetIt.instance<LookupsService>();
|
||||
@@ -37,46 +38,46 @@ class EquipmentStatusChip extends StatelessWidget {
|
||||
switch (status) {
|
||||
case EquipmentStatus.in_:
|
||||
case 'in':
|
||||
backgroundColor = Colors.green;
|
||||
backgroundColor = ShadcnTheme.equipmentIn;
|
||||
if (statusText == status) statusText = '입고';
|
||||
break;
|
||||
case EquipmentStatus.out:
|
||||
case 'out':
|
||||
backgroundColor = Colors.orange;
|
||||
backgroundColor = ShadcnTheme.equipmentOut;
|
||||
if (statusText == status) statusText = '출고';
|
||||
break;
|
||||
case EquipmentStatus.rent:
|
||||
case 'rent':
|
||||
backgroundColor = Colors.blue;
|
||||
backgroundColor = ShadcnTheme.equipmentRent;
|
||||
if (statusText == status) statusText = '대여';
|
||||
break;
|
||||
case EquipmentStatus.repair:
|
||||
case 'repair':
|
||||
backgroundColor = Colors.blue;
|
||||
backgroundColor = ShadcnTheme.equipmentRepair;
|
||||
if (statusText == status) statusText = '수리중';
|
||||
break;
|
||||
case EquipmentStatus.damaged:
|
||||
case 'damaged':
|
||||
backgroundColor = Colors.red;
|
||||
backgroundColor = ShadcnTheme.error;
|
||||
if (statusText == status) statusText = '손상';
|
||||
break;
|
||||
case EquipmentStatus.lost:
|
||||
case 'lost':
|
||||
backgroundColor = Colors.purple;
|
||||
backgroundColor = ShadcnTheme.purple;
|
||||
if (statusText == status) statusText = '분실';
|
||||
break;
|
||||
case EquipmentStatus.disposed:
|
||||
case 'disposed':
|
||||
backgroundColor = Colors.black;
|
||||
backgroundColor = ShadcnTheme.equipmentDisposal;
|
||||
if (statusText == status) statusText = '폐기';
|
||||
break;
|
||||
case EquipmentStatus.etc:
|
||||
case 'etc':
|
||||
backgroundColor = Colors.grey;
|
||||
backgroundColor = ShadcnTheme.secondary;
|
||||
if (statusText == status) statusText = '기타';
|
||||
break;
|
||||
default:
|
||||
backgroundColor = Colors.grey;
|
||||
backgroundColor = ShadcnTheme.equipmentUnknown;
|
||||
if (statusText == status) statusText = '알 수 없음';
|
||||
}
|
||||
|
||||
@@ -84,11 +85,15 @@ class EquipmentStatusChip extends StatelessWidget {
|
||||
return Chip(
|
||||
label: Text(
|
||||
statusText,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 12),
|
||||
style: ShadcnTheme.labelSmall.copyWith(color: ShadcnTheme.primaryForeground),
|
||||
),
|
||||
backgroundColor: backgroundColor,
|
||||
visualDensity: VisualDensity.compact,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusFull),
|
||||
side: BorderSide(color: backgroundColor.withValues(alpha: 0.2)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
// 장비 요약 정보 행 위젯 (SRP, 재사용성)
|
||||
class EquipmentSummaryRow extends StatelessWidget {
|
||||
@@ -30,7 +31,9 @@ class EquipmentSummaryRow extends StatelessWidget {
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
color: value == '정보 없음' ? Colors.grey.shade600 : Colors.black,
|
||||
color: value == '정보 없음'
|
||||
? ShadcnTheme.mutedForeground
|
||||
: ShadcnTheme.foreground,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user