refactor: UI 일관성 개선 및 테이블 구조 통일
장비관리 화면을 기준으로 전체 화면 UI 일관성 개선: - 모든 화면 검색바/버튼/드롭다운 높이 40px 통일 - 테이블 헤더 패딩 vertical 10px, 행 패딩 vertical 4px 통일 - 배지 스타일 통일 (border 제거, opacity 0.9 적용) - 페이지네이션 10개 이하에서도 항상 표시 - 테이블 헤더 폰트 스타일 통일 (fontSize: 13, fontWeight: w500) 각 화면별 수정사항: 1. 장비관리: 컬럼 너비 최적화, 검색 컴포넌트 높이 명시 2. 입고지 관리: 페이지네이션 조건 개선 3. 회사관리: UnifiedSearchBar 통합, 배지 스타일 개선 4. 유지보수: ListView.builder → map() 변경, 테이블 구조 재설계 키포인트 색상을 teal로 통일하여 브랜드 일관성 확보
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
|
||||
/// 페이지네이션 위젯 (<< < 1 2 3 ... 10 > >>)
|
||||
/// - totalCount: 전체 아이템 수
|
||||
@@ -33,56 +34,105 @@ class Pagination extends StatelessWidget {
|
||||
for (int i = startPage; i <= endPage; i++) {
|
||||
pageButtons.add(
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 2),
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(
|
||||
minimumSize: const Size(36, 36),
|
||||
backgroundColor: i == currentPage ? Colors.blue : Colors.white,
|
||||
foregroundColor: i == currentPage ? Colors.white : Colors.black,
|
||||
padding: EdgeInsets.zero,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
child: InkWell(
|
||||
onTap: i == currentPage ? 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,
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
border: Border.all(
|
||||
color: i == currentPage ? ShadcnTheme.primary : Colors.black,
|
||||
),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
'$i',
|
||||
style: ShadcnTheme.labelMedium.copyWith(
|
||||
color: i == currentPage
|
||||
? ShadcnTheme.primaryForeground
|
||||
: ShadcnTheme.foreground,
|
||||
),
|
||||
),
|
||||
),
|
||||
onPressed: i == currentPage ? null : () => onPageChanged(i),
|
||||
child: Text('$i'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// 가장 처음 페이지로 이동
|
||||
IconButton(
|
||||
icon: const Icon(Icons.first_page),
|
||||
tooltip: '처음',
|
||||
onPressed: currentPage > 1 ? () => onPageChanged(1) : null,
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(vertical: ShadcnTheme.spacing4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// 가장 처음 페이지로 이동
|
||||
_buildNavigationButton(
|
||||
icon: Icons.first_page,
|
||||
tooltip: '처음',
|
||||
onPressed: currentPage > 1 ? () => onPageChanged(1) : null,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
// 이전 페이지로 이동
|
||||
_buildNavigationButton(
|
||||
icon: Icons.chevron_left,
|
||||
tooltip: '이전',
|
||||
onPressed: currentPage > 1 ? () => onPageChanged(currentPage - 1) : null,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
// 페이지 번호 버튼들
|
||||
...pageButtons,
|
||||
const SizedBox(width: 8),
|
||||
// 다음 페이지로 이동
|
||||
_buildNavigationButton(
|
||||
icon: Icons.chevron_right,
|
||||
tooltip: '다음',
|
||||
onPressed: currentPage < totalPages
|
||||
? () => onPageChanged(currentPage + 1)
|
||||
: null,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
// 마짉 페이지로 이동
|
||||
_buildNavigationButton(
|
||||
icon: Icons.last_page,
|
||||
tooltip: '마짉',
|
||||
onPressed: currentPage < totalPages ? () => onPageChanged(totalPages) : null,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildNavigationButton({
|
||||
required IconData icon,
|
||||
required String tooltip,
|
||||
VoidCallback? onPressed,
|
||||
}) {
|
||||
final isDisabled = onPressed == null;
|
||||
return Tooltip(
|
||||
message: tooltip,
|
||||
child: InkWell(
|
||||
onTap: onPressed,
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
child: Container(
|
||||
height: 32,
|
||||
width: 32,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
border: Border.all(
|
||||
color: isDisabled ? ShadcnTheme.muted : Colors.black,
|
||||
),
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
size: 18,
|
||||
color: isDisabled ? ShadcnTheme.mutedForeground : ShadcnTheme.foreground,
|
||||
),
|
||||
),
|
||||
// 이전 페이지로 이동
|
||||
IconButton(
|
||||
icon: const Icon(Icons.chevron_left),
|
||||
tooltip: '이전',
|
||||
onPressed:
|
||||
currentPage > 1 ? () => onPageChanged(currentPage - 1) : null,
|
||||
),
|
||||
// 페이지 번호 버튼들
|
||||
...pageButtons,
|
||||
// 다음 페이지로 이동
|
||||
IconButton(
|
||||
icon: const Icon(Icons.chevron_right),
|
||||
tooltip: '다음',
|
||||
onPressed:
|
||||
currentPage < totalPages
|
||||
? () => onPageChanged(currentPage + 1)
|
||||
: null,
|
||||
),
|
||||
// 마지막 페이지로 이동
|
||||
IconButton(
|
||||
icon: const Icon(Icons.last_page),
|
||||
tooltip: '마지막',
|
||||
onPressed:
|
||||
currentPage < totalPages ? () => onPageChanged(totalPages) : null,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user