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';
|
||||
import 'package:shadcn_ui/shadcn_ui.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
|
||||
@@ -171,13 +172,13 @@ class _RentFormDialogState extends State<RentFormDialog> {
|
||||
|
||||
// 3단계 상태 처리 (UserForm 패턴 적용)
|
||||
_isLoadingHistories
|
||||
? const SizedBox(
|
||||
? SizedBox(
|
||||
height: 56,
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ShadProgress(),
|
||||
children: const [
|
||||
SizedBox(width: 120, child: ShadProgress()),
|
||||
SizedBox(width: 8),
|
||||
Text('장비 이력을 불러오는 중...'),
|
||||
],
|
||||
@@ -229,33 +230,33 @@ class _RentFormDialogState extends State<RentFormDialog> {
|
||||
options: _historyController.historyList.map((history) {
|
||||
return ShadOption(
|
||||
value: history.id!,
|
||||
child: Row(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'${history.equipment?.serialNumber ?? "Serial N/A"} - ${history.equipment?.modelName ?? "Model N/A"}',
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
'거래: ${history.transactionType} | 수량: ${history.quantity} | ${history.transactedAt.toString().split(' ')[0]}',
|
||||
style: const TextStyle(fontSize: 12, color: Colors.grey),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'${history.equipment?.serialNumber ?? "Serial N/A"} - ${history.equipment?.modelName ?? "Model N/A"}',
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
'거래: ${history.transactionType} | 수량: ${history.quantity} | ${history.transactedAt.toString().split(' ')[0]}',
|
||||
style: const TextStyle(fontSize: 12, color: Colors.grey),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
selectedOptionBuilder: (context, value) {
|
||||
if (_historyController.historyList.isEmpty) {
|
||||
return const Text('이력 없음');
|
||||
}
|
||||
final selectedHistory = _historyController.historyList
|
||||
.firstWhere((h) => h.id == value);
|
||||
.firstWhere(
|
||||
(h) => h.id == value,
|
||||
orElse: () => _historyController.historyList.first,
|
||||
);
|
||||
return Text(
|
||||
'${selectedHistory.equipment?.serialNumber ?? "Serial N/A"} - ${selectedHistory.equipment?.modelName ?? "Model N/A"}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -328,7 +329,7 @@ class _RentFormDialogState extends State<RentFormDialog> {
|
||||
: '날짜 선택',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: _endDate != null ? Colors.black : Colors.grey,
|
||||
color: _endDate != null ? ShadcnTheme.foreground : ShadcnTheme.mutedForeground,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -397,4 +398,4 @@ class _RentFormDialogState extends State<RentFormDialog> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user