feat(dialog): 상세 팝업 SuperportDetailDialog 통합

- SuperportDetailDialog 위젯과 showSuperportDetailDialog 헬퍼를 추가하고 metadata/섹션 패턴을 표준화

- 결재/재고/마스터 각 상세 다이얼로그를 dialogs 디렉터리에 신설하고 기존 페이지를 신규 팝업으로 전환

- SuperportTable 행 선택과 우편번호 검색 다이얼로그 onRowTap 보정을 통해 헤더 오프셋 버그를 제거

- 상세 다이얼로그 및 트랜잭션/상세 뷰 전용 위젯 테스트와 tester_extensions 유틸을 추가하여 회귀를 방지

- detail_dialog_unification_plan.md로 작업 배경과 필드 통합 계획을 문서화
This commit is contained in:
JiWoong Sul
2025-11-07 19:02:43 +09:00
parent 1f78171294
commit 2f8b529506
64 changed files with 13721 additions and 7545 deletions

View File

@@ -45,6 +45,10 @@ import '../widgets/outbound_detail_view.dart';
const String _outboundTransactionTypeId = '출고';
class _OutboundDetailSections {
static const lines = 'lines';
}
/// 출고 목록과 등록/수정 모달을 관리하는 페이지.
class OutboundPage extends StatefulWidget {
const OutboundPage({super.key, required this.routeUri});
@@ -650,7 +654,11 @@ class _OutboundPageState extends State<OutboundPage> {
OutboundTableSpec.rowSpanHeight,
),
onRowTap: (rowIndex) {
final record = visibleRecords[rowIndex];
if (rowIndex <= 0 ||
rowIndex > visibleRecords.length) {
return;
}
final record = visibleRecords[rowIndex - 1];
_selectRecord(record, openDetail: true);
},
);
@@ -870,18 +878,109 @@ class _OutboundPageState extends State<OutboundPage> {
await showInventoryTransactionDetailDialog<void>(
context: context,
title: '출고 상세',
transactionNumber: record.transactionNumber,
body: OutboundDetailView(
record: record,
dateFormatter: _dateFormatter,
currencyFormatter: _currencyFormatter,
transitionsEnabled: _transitionsEnabled,
),
description: '출고 고객사와 라인 품목 정보를 확인하세요.',
summary: _buildOutboundDetailSummary(record),
summaryBadges: _buildOutboundDetailBadges(record),
metadata: _buildOutboundDetailMetadata(record),
sections: [
SuperportDetailDialogSection(
id: _OutboundDetailSections.lines,
label: '라인 품목',
icon: lucide.LucideIcons.listChecks,
builder: (_) => OutboundDetailView(
record: record,
currencyFormatter: _currencyFormatter,
transitionsEnabled: _transitionsEnabled,
),
),
],
initialSectionId: _OutboundDetailSections.lines,
actions: _buildDetailActions(record),
constraints: const BoxConstraints(maxWidth: 920),
);
}
Widget _buildOutboundDetailSummary(OutboundRecord record) {
final theme = ShadTheme.of(context);
final processedAt = _dateFormatter.format(record.processedAt);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(record.transactionNumber, style: theme.textTheme.h4),
const SizedBox(height: 4),
Text(
'$processedAt · ${record.transactionType}',
style: theme.textTheme.muted,
),
],
);
}
List<Widget> _buildOutboundDetailBadges(OutboundRecord record) {
return [
ShadBadge(child: Text(record.status)),
ShadBadge.outline(child: Text('고객 ${record.customerCount}')),
];
}
List<SuperportDetailMetadata> _buildOutboundDetailMetadata(
OutboundRecord record,
) {
return [
SuperportDetailMetadata.text(
label: '트랜잭션번호',
value: record.transactionNumber,
),
SuperportDetailMetadata.text(
label: '처리일자',
value: _dateFormatter.format(record.processedAt),
),
SuperportDetailMetadata.text(
label: '트랜잭션 유형',
value: record.transactionType,
),
SuperportDetailMetadata.text(label: '상태', value: record.status),
SuperportDetailMetadata.text(label: '작성자', value: record.writer),
SuperportDetailMetadata.text(label: '창고', value: record.warehouse),
SuperportDetailMetadata.text(
label: '창고 코드',
value: _dashIfEmpty(record.warehouseCode),
),
SuperportDetailMetadata.text(
label: '창고 우편번호',
value: _dashIfEmpty(record.warehouseZipcode),
),
SuperportDetailMetadata.text(
label: '창고 주소',
value: _dashIfEmpty(record.warehouseAddress),
),
SuperportDetailMetadata.text(
label: '고객 수',
value: '${record.customerCount}',
),
SuperportDetailMetadata.text(label: '품목 수', value: '${record.itemCount}'),
SuperportDetailMetadata.text(
label: '총 수량',
value: '${record.totalQuantity}',
),
SuperportDetailMetadata.text(
label: '총 금액',
value: _currencyFormatter.format(record.totalAmount),
),
SuperportDetailMetadata.text(
label: '비고',
value: _dashIfEmpty(record.remark),
),
];
}
String _dashIfEmpty(String? value) {
if (value == null) {
return '-';
}
final trimmed = value.trim();
return trimmed.isEmpty ? '-' : trimmed;
}
List<Widget> _buildDetailActions(OutboundRecord record) {
final isProcessing = _isProcessing(record.id) || _isLoading;
final actions = <Widget>[];