perf(app): 초기화 병렬 처리 및 UI 개선
## 성능 최적화 ### main.dart - 앱 초기화 병렬 처리 (Future.wait 활용) - 광고 SDK, Hive 초기화 동시 실행 - Hive Box 오픈 병렬 처리 - 코드 구조화 (_initializeHive, _initializeNotifications) ### visit_provider.dart - allLastVisitDatesProvider 추가 - 리스트 화면에서 N+1 쿼리 방지 - 모든 맛집의 마지막 방문일 일괄 조회 ## UI 개선 ### 각 화면 리팩토링 - AppDimensions 상수 적용 - 스켈레톤 로더 적용 - 코드 정리 및 일관성 개선
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:table_calendar/table_calendar.dart';
|
||||
import '../../../core/constants/app_colors.dart';
|
||||
import '../../../core/constants/app_typography.dart';
|
||||
import '../../../core/widgets/info_row.dart';
|
||||
import '../../../domain/entities/restaurant.dart';
|
||||
import '../../../domain/entities/recommendation_record.dart';
|
||||
import '../../../domain/entities/visit_record.dart';
|
||||
@@ -607,18 +608,25 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildInfoRow('주소', restaurant.roadAddress, isDark),
|
||||
InfoRow(
|
||||
label: '주소',
|
||||
value: restaurant.roadAddress,
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
if (visitTime != null)
|
||||
_buildInfoRow(
|
||||
isVisitConfirmed ? '방문 완료' : '방문 예정',
|
||||
_formatFullDateTime(visitTime),
|
||||
isDark,
|
||||
InfoRow(
|
||||
label: isVisitConfirmed ? '방문 완료' : '방문 예정',
|
||||
value: _formatFullDateTime(visitTime),
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
if (recoTime != null)
|
||||
_buildInfoRow(
|
||||
'추천 시각',
|
||||
_formatFullDateTime(recoTime),
|
||||
isDark,
|
||||
InfoRow(
|
||||
label: '추천 시각',
|
||||
value: _formatFullDateTime(recoTime),
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Wrap(
|
||||
@@ -703,23 +711,6 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow(String label, String value, bool isDark) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 80,
|
||||
child: Text(label, style: AppTypography.caption(isDark)),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(child: Text(value, style: AppTypography.body2(isDark))),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _showRestaurantDetailDialog(
|
||||
BuildContext context,
|
||||
bool isDark,
|
||||
@@ -737,18 +728,39 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildInfoRow(
|
||||
'카테고리',
|
||||
'${restaurant.category} > ${restaurant.subCategory}',
|
||||
isDark,
|
||||
InfoRow(
|
||||
label: '카테고리',
|
||||
value: '${restaurant.category} > ${restaurant.subCategory}',
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
if (restaurant.phoneNumber != null)
|
||||
_buildInfoRow('전화번호', restaurant.phoneNumber!, isDark),
|
||||
_buildInfoRow('도로명', restaurant.roadAddress, isDark),
|
||||
_buildInfoRow('지번', restaurant.jibunAddress, isDark),
|
||||
InfoRow(
|
||||
label: '전화번호',
|
||||
value: restaurant.phoneNumber!,
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
InfoRow(
|
||||
label: '도로명',
|
||||
value: restaurant.roadAddress,
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
InfoRow(
|
||||
label: '지번',
|
||||
value: restaurant.jibunAddress,
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
if (restaurant.description != null &&
|
||||
restaurant.description!.isNotEmpty)
|
||||
_buildInfoRow('메모', restaurant.description!, isDark),
|
||||
InfoRow(
|
||||
label: '메모',
|
||||
value: restaurant.description!,
|
||||
isDark: isDark,
|
||||
horizontal: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user