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:
109
lib/screens/common/widgets/unified_search_bar.dart
Normal file
109
lib/screens/common/widgets/unified_search_bar.dart
Normal file
@@ -0,0 +1,109 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:superport/screens/common/theme_shadcn.dart';
|
||||
import 'package:superport/screens/common/components/shadcn_components.dart';
|
||||
|
||||
/// 통일된 검색바 위젯
|
||||
///
|
||||
/// 모든 리스트 화면에서 동일한 스타일과 동작을 보장
|
||||
class UnifiedSearchBar extends StatelessWidget {
|
||||
final TextEditingController controller;
|
||||
final String placeholder;
|
||||
final VoidCallback onSearch;
|
||||
final ValueChanged<String>? onChanged; // 실시간 검색을 위한 콜백
|
||||
final VoidCallback? onClear;
|
||||
final Widget? suffixButton; // 검색 버튼 외 추가 버튼
|
||||
final List<Widget>? filters; // 필터 위젯들
|
||||
final bool showSearchButton;
|
||||
|
||||
const UnifiedSearchBar({
|
||||
Key? key,
|
||||
required this.controller,
|
||||
this.placeholder = '검색어를 입력하세요...',
|
||||
required this.onSearch,
|
||||
this.onChanged,
|
||||
this.onClear,
|
||||
this.suffixButton,
|
||||
this.filters,
|
||||
this.showSearchButton = true,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
// 검색 입력 필드
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: ShadcnTheme.card,
|
||||
borderRadius: BorderRadius.circular(ShadcnTheme.radiusMd),
|
||||
border: Border.all(color: Colors.black),
|
||||
),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
onChanged: onChanged,
|
||||
onSubmitted: (_) => onSearch(),
|
||||
decoration: InputDecoration(
|
||||
hintText: placeholder,
|
||||
hintStyle: TextStyle(color: ShadcnTheme.muted),
|
||||
prefixIcon: Icon(Icons.search, color: ShadcnTheme.muted, size: 20),
|
||||
suffixIcon: controller.text.isNotEmpty && onClear != null
|
||||
? IconButton(
|
||||
icon: Icon(Icons.clear, color: ShadcnTheme.muted, size: 18),
|
||||
onPressed: () {
|
||||
controller.clear();
|
||||
onClear!();
|
||||
},
|
||||
padding: EdgeInsets.zero,
|
||||
constraints: const BoxConstraints(maxHeight: 40, maxWidth: 40),
|
||||
)
|
||||
: null,
|
||||
border: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 검색 버튼
|
||||
if (showSearchButton) ...[
|
||||
const SizedBox(width: ShadcnTheme.spacing2),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: ShadcnButton(
|
||||
text: '검색',
|
||||
onPressed: onSearch,
|
||||
variant: ShadcnButtonVariant.primary,
|
||||
textColor: Colors.white,
|
||||
icon: const Icon(Icons.search, size: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
// 추가 버튼 (예: 추가, 필터 등)
|
||||
if (suffixButton != null) ...[
|
||||
const SizedBox(width: ShadcnTheme.spacing2),
|
||||
suffixButton!,
|
||||
],
|
||||
],
|
||||
),
|
||||
|
||||
// 필터 섹션
|
||||
if (filters != null && filters!.isNotEmpty) ...[
|
||||
const SizedBox(height: ShadcnTheme.spacing3),
|
||||
Row(
|
||||
children: [
|
||||
...filters!.map((filter) => Padding(
|
||||
padding: const EdgeInsets.only(right: ShadcnTheme.spacing2),
|
||||
child: filter,
|
||||
)),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user