feat(ui): full‑width ShadTable across app; fix rent dialog width; correct equipment pagination
Some checks failed
Flutter Test & Quality Check / Test on macos-latest (push) Has been cancelled
Flutter Test & Quality Check / Test on ubuntu-latest (push) Has been cancelled
Flutter Test & Quality Check / Build APK (push) Has been cancelled

- 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:
JiWoong Sul
2025-09-09 22:38:08 +09:00
parent 655d473413
commit 49b203d366
67 changed files with 2305 additions and 1933 deletions

View File

@@ -132,21 +132,14 @@ class _AddressInputState extends State<AddressInput> {
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: BoxConstraints(maxHeight: maxHeight),
child: SingleChildScrollView(
@@ -244,7 +237,7 @@ class _AddressInputState extends State<AddressInput> {
color:
_selectedRegion.isEmpty
? Colors.grey.shade600
: Colors.black,
: ShadcnTheme.foreground,
),
),
const Icon(Icons.arrow_drop_down),

View File

@@ -22,13 +22,20 @@ class Pagination extends StatelessWidget {
@override
Widget build(BuildContext context) {
// 전체 페이지 수 계산
final int totalPages = (totalCount / pageSize).ceil();
// 방어적 계산: pageSize, currentPage, totalPages 모두 안전 범위로 보정
final int safePageSize = pageSize <= 0 ? 1 : pageSize;
final int computedTotalPages = (totalCount / safePageSize).ceil();
final int totalPages = computedTotalPages < 1 ? 1 : computedTotalPages;
final int current = currentPage < 1
? 1
: (currentPage > totalPages ? totalPages : currentPage);
// 페이지네이션 버튼 최대 10개
final int maxButtons = 10;
// 시작 페이지 계산
int startPage = ((currentPage - 1) ~/ maxButtons) * maxButtons + 1;
int endPage = (startPage + maxButtons - 1).clamp(1, totalPages);
const int maxButtons = 10;
// 시작/끝 페이지 계산
int startPage = ((current - 1) ~/ maxButtons) * maxButtons + 1;
int endPage = startPage + maxButtons - 1;
if (endPage > totalPages) endPage = totalPages;
List<Widget> pageButtons = [];
for (int i = startPage; i <= endPage; i++) {
@@ -36,25 +43,25 @@ class Pagination extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: InkWell(
onTap: i == currentPage ? null : () => onPageChanged(i),
onTap: i == current ? null : () => onPageChanged(i),
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
child: Container(
height: 32,
constraints: const BoxConstraints(minWidth: 32),
padding: const EdgeInsets.symmetric(horizontal: 8),
decoration: BoxDecoration(
color: i == currentPage ? ShadcnTheme.primary : Colors.transparent,
color: i == current ? ShadcnTheme.primary : Colors.transparent,
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
border: Border.all(
color: i == currentPage ? ShadcnTheme.primary : Colors.black,
color: i == currentPage ? ShadcnTheme.primary : ShadcnTheme.border,
),
),
alignment: Alignment.center,
child: Text(
'$i',
style: ShadcnTheme.labelMedium.copyWith(
color: i == currentPage
? ShadcnTheme.primaryForeground
color: i == current
? ShadcnTheme.primaryForeground
: ShadcnTheme.foreground,
),
),
@@ -73,14 +80,14 @@ class Pagination extends StatelessWidget {
_buildNavigationButton(
icon: Icons.first_page,
tooltip: '처음',
onPressed: currentPage > 1 ? () => onPageChanged(1) : null,
onPressed: current > 1 ? () => onPageChanged(1) : null,
),
const SizedBox(width: 4),
// 이전 페이지로 이동
_buildNavigationButton(
icon: Icons.chevron_left,
tooltip: '이전',
onPressed: currentPage > 1 ? () => onPageChanged(currentPage - 1) : null,
onPressed: current > 1 ? () => onPageChanged(current - 1) : null,
),
const SizedBox(width: 8),
// 페이지 번호 버튼들
@@ -90,8 +97,8 @@ class Pagination extends StatelessWidget {
_buildNavigationButton(
icon: Icons.chevron_right,
tooltip: '다음',
onPressed: currentPage < totalPages
? () => onPageChanged(currentPage + 1)
onPressed: current < totalPages
? () => onPageChanged(current + 1)
: null,
),
const SizedBox(width: 4),
@@ -99,7 +106,7 @@ class Pagination extends StatelessWidget {
_buildNavigationButton(
icon: Icons.last_page,
tooltip: '마짉',
onPressed: currentPage < totalPages ? () => onPageChanged(totalPages) : null,
onPressed: current < totalPages ? () => onPageChanged(totalPages) : null,
),
],
),
@@ -123,7 +130,7 @@ class Pagination extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
border: Border.all(
color: isDisabled ? ShadcnTheme.muted : Colors.black,
color: isDisabled ? ShadcnTheme.muted : ShadcnTheme.border,
),
),
child: Icon(

View File

@@ -141,7 +141,7 @@ class StandardActionButtons {
text: text,
onPressed: onPressed,
variant: ShadcnButtonVariant.primary,
textColor: Colors.white,
textColor: ShadcnTheme.primaryForeground,
icon: Icon(icon, size: 16),
);
}
@@ -237,7 +237,7 @@ class StandardFilterDropdown<T> extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 12),
decoration: BoxDecoration(
color: ShadcnTheme.card,
border: Border.all(color: Colors.black),
border: Border.all(color: ShadcnTheme.border),
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
),
child: DropdownButtonHideUnderline(
@@ -252,4 +252,4 @@ class StandardFilterDropdown<T> extends StatelessWidget {
),
);
}
}
}

View File

@@ -306,7 +306,7 @@ class StandardDataRow extends StatelessWidget {
? ShadcnTheme.muted.withValues(alpha: 0.1)
: null,
border: Border(
bottom: BorderSide(color: Colors.black),
bottom: BorderSide(color: ShadcnTheme.border),
),
),
child: Row(
@@ -418,4 +418,4 @@ class StandardActionButtons extends StatelessWidget {
tooltip: tooltip,
);
}
}
}

View File

@@ -76,13 +76,13 @@ class StandardErrorState extends StatelessWidget {
],
if (onRetry != null) ...[
const SizedBox(height: ShadcnTheme.spacing6),
ShadcnButton(
text: '다시 시도',
onPressed: onRetry,
variant: ShadcnButtonVariant.primary,
textColor: Colors.white,
icon: const Icon(Icons.refresh, size: 16),
),
ShadcnButton(
text: '다시 시도',
onPressed: onRetry,
variant: ShadcnButtonVariant.primary,
textColor: ShadcnTheme.primaryForeground,
icon: const Icon(Icons.refresh, size: 16),
),
],
],
),
@@ -185,10 +185,7 @@ class StandardInfoMessage extends StatelessWidget {
Expanded(
child: Text(
message,
style: TextStyle(
color: displayColor,
fontSize: 14,
),
style: ShadcnTheme.bodySmall.copyWith(color: displayColor),
),
),
if (onClose != null)
@@ -235,14 +232,8 @@ class StandardStatCard extends StatelessWidget {
decoration: BoxDecoration(
color: ShadcnTheme.card,
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
border: Border.all(color: Colors.black),
boxShadow: [
BoxShadow(
color: Colors.black.withValues(alpha: 0.05),
blurRadius: 10,
offset: const Offset(0, 4),
),
],
border: Border.all(color: ShadcnTheme.border),
boxShadow: ShadcnTheme.shadowSm,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -294,4 +285,4 @@ class StandardStatCard extends StatelessWidget {
),
);
}
}
}

View File

@@ -40,7 +40,7 @@ class UnifiedSearchBar extends StatelessWidget {
decoration: BoxDecoration(
color: ShadcnTheme.card,
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
border: Border.all(color: Colors.black),
border: Border.all(color: ShadcnTheme.border),
),
child: TextField(
controller: controller,
@@ -77,7 +77,7 @@ class UnifiedSearchBar extends StatelessWidget {
text: '검색',
onPressed: onSearch,
variant: ShadcnButtonVariant.primary,
textColor: Colors.white,
textColor: ShadcnTheme.primaryForeground,
icon: const Icon(Icons.search, size: 16),
),
),
@@ -106,4 +106,4 @@ class UnifiedSearchBar extends StatelessWidget {
],
);
}
}
}