Files
lunchpick/lib/core/widgets/info_row.dart
JiWoong Sul 21941443ee feat(core): 공통 UI 컴포넌트 및 상수 추가
## 새 파일

### AppDimensions (app_dimensions.dart)
- UI 관련 상수 중앙 집중화
- 패딩, 마진, 보더 레디우스, 아이콘 크기 등 정의
- 하드코딩된 값을 상수로 대체하여 일관성 확보

### InfoRow (info_row.dart)
- 레이블-값 쌍을 표시하는 공통 위젯
- 수평/수직 배치 지원

### SkeletonLoader (skeleton_loader.dart)
- Shimmer 효과를 가진 스켈레톤 로더
- RestaurantCardSkeleton, RestaurantListSkeleton 포함
- 로딩 상태 UX 개선
2026-01-12 15:15:56 +09:00

59 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import '../constants/app_dimensions.dart';
import '../constants/app_typography.dart';
/// 상세 정보를 표시하는 공통 행 위젯
/// [label]과 [value]를 수직 또는 수평으로 배치
class InfoRow extends StatelessWidget {
final String label;
final String value;
final bool isDark;
/// true: 수평 배치 (레이블 | 값), false: 수직 배치 (레이블 위, 값 아래)
final bool horizontal;
/// 수평 배치 시 레이블 영역 너비
final double? labelWidth;
const InfoRow({
super.key,
required this.label,
required this.value,
required this.isDark,
this.horizontal = false,
this.labelWidth = 80,
});
@override
Widget build(BuildContext context) {
if (horizontal) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: AppDimensions.paddingXs),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: labelWidth,
child: Text(label, style: AppTypography.caption(isDark)),
),
const SizedBox(width: AppDimensions.paddingSm),
Expanded(child: Text(value, style: AppTypography.body2(isDark))),
],
),
);
}
return Padding(
padding: const EdgeInsets.symmetric(vertical: AppDimensions.paddingXs),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label, style: AppTypography.caption(isDark)),
const SizedBox(height: 2),
Text(value, style: AppTypography.body2(isDark)),
],
),
);
}
}