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:
@@ -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)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user