feat(app): add manual entry and sharing flows
This commit is contained in:
@@ -19,19 +19,13 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
|
||||
return AlertDialog(
|
||||
backgroundColor: isDark ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
||||
title: Column(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.restaurant,
|
||||
size: 48,
|
||||
color: AppColors.lightPrimary,
|
||||
),
|
||||
Icon(Icons.restaurant, size: 48, color: AppColors.lightPrimary),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'다녀왔음? 🍴',
|
||||
@@ -45,9 +39,9 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
children: [
|
||||
Text(
|
||||
restaurantName,
|
||||
style: AppTypography.heading2(isDark).copyWith(
|
||||
color: AppColors.lightPrimary,
|
||||
),
|
||||
style: AppTypography.heading2(
|
||||
isDark,
|
||||
).copyWith(color: AppColors.lightPrimary),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -60,7 +54,9 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: (isDark ? AppColors.darkBackground : AppColors.lightBackground),
|
||||
color: (isDark
|
||||
? AppColors.darkBackground
|
||||
: AppColors.lightBackground),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Row(
|
||||
@@ -69,7 +65,9 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
Icon(
|
||||
Icons.access_time,
|
||||
size: 16,
|
||||
color: isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary,
|
||||
color: isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
@@ -93,7 +91,9 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
child: Text(
|
||||
'안 갔어요',
|
||||
style: AppTypography.body1(isDark).copyWith(
|
||||
color: isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary,
|
||||
color: isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -103,15 +103,17 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
child: ElevatedButton(
|
||||
onPressed: () async {
|
||||
// 방문 기록 추가
|
||||
await ref.read(visitNotifierProvider.notifier).addVisitRecord(
|
||||
restaurantId: restaurantId,
|
||||
visitDate: DateTime.now(),
|
||||
isConfirmed: true,
|
||||
);
|
||||
|
||||
await ref
|
||||
.read(visitNotifierProvider.notifier)
|
||||
.addVisitRecord(
|
||||
restaurantId: restaurantId,
|
||||
visitDate: DateTime.now(),
|
||||
isConfirmed: true,
|
||||
);
|
||||
|
||||
if (context.mounted) {
|
||||
Navigator.of(context).pop(true);
|
||||
|
||||
|
||||
// 성공 메시지 표시
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
@@ -164,4 +166,4 @@ class VisitConfirmationDialog extends ConsumerWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,7 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
final VisitRecord visitRecord;
|
||||
final VoidCallback? onTap;
|
||||
|
||||
const VisitRecordCard({
|
||||
super.key,
|
||||
required this.visitRecord,
|
||||
this.onTap,
|
||||
});
|
||||
const VisitRecordCard({super.key, required this.visitRecord, this.onTap});
|
||||
|
||||
String _formatTime(DateTime dateTime) {
|
||||
final hour = dateTime.hour.toString().padLeft(2, '0');
|
||||
@@ -27,7 +23,7 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: isConfirmed
|
||||
color: isConfirmed
|
||||
? AppColors.lightPrimary.withValues(alpha: 0.1)
|
||||
: Colors.orange.withValues(alpha: 0.1),
|
||||
shape: BoxShape.circle,
|
||||
@@ -43,7 +39,9 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final restaurantAsync = ref.watch(restaurantProvider(visitRecord.restaurantId));
|
||||
final restaurantAsync = ref.watch(
|
||||
restaurantProvider(visitRecord.restaurantId),
|
||||
);
|
||||
|
||||
return restaurantAsync.when(
|
||||
data: (restaurant) {
|
||||
@@ -73,9 +71,9 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
children: [
|
||||
Text(
|
||||
restaurant.name,
|
||||
style: AppTypography.body1(isDark).copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: AppTypography.body1(
|
||||
isDark,
|
||||
).copyWith(fontWeight: FontWeight.bold),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -85,7 +83,9 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
Icon(
|
||||
Icons.category_outlined,
|
||||
size: 14,
|
||||
color: isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary,
|
||||
color: isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
@@ -96,7 +96,9 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
Icon(
|
||||
Icons.access_time,
|
||||
size: 14,
|
||||
color: isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary,
|
||||
color: isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
@@ -121,15 +123,21 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
PopupMenuButton<String>(
|
||||
icon: Icon(
|
||||
Icons.more_vert,
|
||||
color: isDark ? AppColors.darkTextSecondary : AppColors.lightTextSecondary,
|
||||
color: isDark
|
||||
? AppColors.darkTextSecondary
|
||||
: AppColors.lightTextSecondary,
|
||||
),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
color: isDark ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
color: isDark
|
||||
? AppColors.darkSurface
|
||||
: AppColors.lightSurface,
|
||||
onSelected: (value) async {
|
||||
if (value == 'confirm' && !visitRecord.isConfirmed) {
|
||||
await ref.read(visitNotifierProvider.notifier).confirmVisit(visitRecord.id);
|
||||
await ref
|
||||
.read(visitNotifierProvider.notifier)
|
||||
.confirmVisit(visitRecord.id);
|
||||
} else if (value == 'delete') {
|
||||
// 삭제 확인 다이얼로그 표시
|
||||
final confirmed = await showDialog<bool>(
|
||||
@@ -139,11 +147,13 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
content: const Text('이 방문 기록을 삭제하시겠습니까?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(false),
|
||||
child: const Text('취소'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
onPressed: () =>
|
||||
Navigator.of(context).pop(true),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: AppColors.lightError,
|
||||
),
|
||||
@@ -152,9 +162,11 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
if (confirmed == true) {
|
||||
await ref.read(visitNotifierProvider.notifier).deleteVisitRecord(visitRecord.id);
|
||||
await ref
|
||||
.read(visitNotifierProvider.notifier)
|
||||
.deleteVisitRecord(visitRecord.id);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -164,7 +176,11 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
value: 'confirm',
|
||||
child: Row(
|
||||
children: [
|
||||
const Icon(Icons.check, color: AppColors.lightPrimary, size: 20),
|
||||
const Icon(
|
||||
Icons.check,
|
||||
color: AppColors.lightPrimary,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text('방문 확인', style: AppTypography.body2(isDark)),
|
||||
],
|
||||
@@ -174,11 +190,18 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
value: 'delete',
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.delete_outline, color: AppColors.lightError, size: 20),
|
||||
const SizedBox(width: 8),
|
||||
Text('삭제', style: AppTypography.body2(isDark).copyWith(
|
||||
Icon(
|
||||
Icons.delete_outline,
|
||||
color: AppColors.lightError,
|
||||
)),
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'삭제',
|
||||
style: AppTypography.body2(
|
||||
isDark,
|
||||
).copyWith(color: AppColors.lightError),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -194,12 +217,10 @@ class VisitRecordCard extends ConsumerWidget {
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
),
|
||||
error: (error, stack) => const SizedBox.shrink(),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,24 +8,23 @@ import 'package:lunchpick/presentation/providers/restaurant_provider.dart';
|
||||
class VisitStatistics extends ConsumerWidget {
|
||||
final DateTime selectedMonth;
|
||||
|
||||
const VisitStatistics({
|
||||
super.key,
|
||||
required this.selectedMonth,
|
||||
});
|
||||
const VisitStatistics({super.key, required this.selectedMonth});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
|
||||
// 월별 통계
|
||||
final monthlyStatsAsync = ref.watch(monthlyVisitStatsProvider((
|
||||
year: selectedMonth.year,
|
||||
month: selectedMonth.month,
|
||||
)));
|
||||
|
||||
final monthlyStatsAsync = ref.watch(
|
||||
monthlyVisitStatsProvider((
|
||||
year: selectedMonth.year,
|
||||
month: selectedMonth.month,
|
||||
)),
|
||||
);
|
||||
|
||||
// 자주 방문한 맛집
|
||||
final frequentRestaurantsAsync = ref.watch(frequentRestaurantsProvider);
|
||||
|
||||
|
||||
// 주간 통계
|
||||
final weeklyStatsAsync = ref.watch(weeklyVisitStatsProvider);
|
||||
|
||||
@@ -36,11 +35,11 @@ class VisitStatistics extends ConsumerWidget {
|
||||
// 이번 달 통계
|
||||
_buildMonthlyStats(monthlyStatsAsync, isDark),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
|
||||
// 주간 통계 차트
|
||||
_buildWeeklyChart(weeklyStatsAsync, isDark),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
|
||||
// 자주 방문한 맛집 TOP 3
|
||||
_buildFrequentRestaurants(frequentRestaurantsAsync, ref, isDark),
|
||||
],
|
||||
@@ -48,13 +47,14 @@ class VisitStatistics extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMonthlyStats(AsyncValue<Map<String, int>> statsAsync, bool isDark) {
|
||||
Widget _buildMonthlyStats(
|
||||
AsyncValue<Map<String, int>> statsAsync,
|
||||
bool isDark,
|
||||
) {
|
||||
return Card(
|
||||
color: isDark ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
elevation: 2,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
@@ -67,12 +67,14 @@ class VisitStatistics extends ConsumerWidget {
|
||||
const SizedBox(height: 16),
|
||||
statsAsync.when(
|
||||
data: (stats) {
|
||||
final totalVisits = stats.values.fold(0, (sum, count) => sum + count);
|
||||
final categoryCounts = stats.entries
|
||||
.where((e) => !e.key.contains('/'))
|
||||
.toList()
|
||||
..sort((a, b) => b.value.compareTo(a.value));
|
||||
|
||||
final totalVisits = stats.values.fold(
|
||||
0,
|
||||
(sum, count) => sum + count,
|
||||
);
|
||||
final categoryCounts =
|
||||
stats.entries.where((e) => !e.key.contains('/')).toList()
|
||||
..sort((a, b) => b.value.compareTo(a.value));
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
_buildStatItem(
|
||||
@@ -87,7 +89,8 @@ class VisitStatistics extends ConsumerWidget {
|
||||
_buildStatItem(
|
||||
icon: Icons.favorite,
|
||||
label: '가장 많이 간 카테고리',
|
||||
value: '${categoryCounts.first.key} (${categoryCounts.first.value}회)',
|
||||
value:
|
||||
'${categoryCounts.first.key} (${categoryCounts.first.value}회)',
|
||||
color: AppColors.lightSecondary,
|
||||
isDark: isDark,
|
||||
),
|
||||
@@ -96,10 +99,8 @@ class VisitStatistics extends ConsumerWidget {
|
||||
);
|
||||
},
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
error: (error, stack) => Text(
|
||||
'통계를 불러올 수 없습니다',
|
||||
style: AppTypography.body2(isDark),
|
||||
),
|
||||
error: (error, stack) =>
|
||||
Text('통계를 불러올 수 없습니다', style: AppTypography.body2(isDark)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -107,35 +108,37 @@ class VisitStatistics extends ConsumerWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWeeklyChart(AsyncValue<Map<String, int>> statsAsync, bool isDark) {
|
||||
Widget _buildWeeklyChart(
|
||||
AsyncValue<Map<String, int>> statsAsync,
|
||||
bool isDark,
|
||||
) {
|
||||
return Card(
|
||||
color: isDark ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
elevation: 2,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'최근 7일 방문 현황',
|
||||
style: AppTypography.heading2(isDark),
|
||||
),
|
||||
Text('최근 7일 방문 현황', style: AppTypography.heading2(isDark)),
|
||||
const SizedBox(height: 16),
|
||||
statsAsync.when(
|
||||
data: (stats) {
|
||||
final maxCount = stats.values.isEmpty ? 1 : stats.values.reduce((a, b) => a > b ? a : b);
|
||||
|
||||
final maxCount = stats.values.isEmpty
|
||||
? 1
|
||||
: stats.values.reduce((a, b) => a > b ? a : b);
|
||||
|
||||
return SizedBox(
|
||||
height: 120,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: stats.entries.map((entry) {
|
||||
final height = maxCount == 0 ? 0.0 : (entry.value / maxCount) * 80;
|
||||
|
||||
final height = maxCount == 0
|
||||
? 0.0
|
||||
: (entry.value / maxCount) * 80;
|
||||
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@@ -153,10 +156,7 @@ class VisitStatistics extends ConsumerWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
entry.key,
|
||||
style: AppTypography.caption(isDark),
|
||||
),
|
||||
Text(entry.key, style: AppTypography.caption(isDark)),
|
||||
],
|
||||
);
|
||||
}).toList(),
|
||||
@@ -164,10 +164,8 @@ class VisitStatistics extends ConsumerWidget {
|
||||
);
|
||||
},
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
error: (error, stack) => Text(
|
||||
'차트를 불러올 수 없습니다',
|
||||
style: AppTypography.body2(isDark),
|
||||
),
|
||||
error: (error, stack) =>
|
||||
Text('차트를 불러올 수 없습니다', style: AppTypography.body2(isDark)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -183,18 +181,13 @@ class VisitStatistics extends ConsumerWidget {
|
||||
return Card(
|
||||
color: isDark ? AppColors.darkSurface : AppColors.lightSurface,
|
||||
elevation: 2,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'자주 방문한 맛집 TOP 3',
|
||||
style: AppTypography.heading2(isDark),
|
||||
),
|
||||
Text('자주 방문한 맛집 TOP 3', style: AppTypography.heading2(isDark)),
|
||||
const SizedBox(height: 16),
|
||||
frequentAsync.when(
|
||||
data: (frequentList) {
|
||||
@@ -206,78 +199,89 @@ class VisitStatistics extends ConsumerWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return Column(
|
||||
children: frequentList.take(3).map((item) {
|
||||
final restaurantAsync = ref.watch(restaurantProvider(item.restaurantId));
|
||||
|
||||
return restaurantAsync.when(
|
||||
data: (restaurant) {
|
||||
if (restaurant == null) return const SizedBox.shrink();
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.lightPrimary.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${frequentList.indexOf(item) + 1}',
|
||||
style: AppTypography.body1(isDark).copyWith(
|
||||
color: AppColors.lightPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
restaurant.name,
|
||||
style: AppTypography.body1(isDark).copyWith(
|
||||
fontWeight: FontWeight.w500,
|
||||
children:
|
||||
frequentList.take(3).map((item) {
|
||||
final restaurantAsync = ref.watch(
|
||||
restaurantProvider(item.restaurantId),
|
||||
);
|
||||
|
||||
return restaurantAsync.when(
|
||||
data: (restaurant) {
|
||||
if (restaurant == null) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.lightPrimary
|
||||
.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'${frequentList.indexOf(item) + 1}',
|
||||
style: AppTypography.body1(isDark)
|
||||
.copyWith(
|
||||
color: AppColors.lightPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
restaurant.category,
|
||||
style: AppTypography.caption(isDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${item.visitCount}회',
|
||||
style: AppTypography.body2(isDark).copyWith(
|
||||
color: AppColors.lightPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
loading: () => const SizedBox(height: 44),
|
||||
error: (error, stack) => const SizedBox.shrink(),
|
||||
);
|
||||
}).toList() as List<Widget>,
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
restaurant.name,
|
||||
style: AppTypography.body1(isDark)
|
||||
.copyWith(
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
restaurant.category,
|
||||
style: AppTypography.caption(
|
||||
isDark,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${item.visitCount}회',
|
||||
style: AppTypography.body2(isDark)
|
||||
.copyWith(
|
||||
color: AppColors.lightPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
loading: () => const SizedBox(height: 44),
|
||||
error: (error, stack) => const SizedBox.shrink(),
|
||||
);
|
||||
}).toList()
|
||||
as List<Widget>,
|
||||
);
|
||||
},
|
||||
loading: () => const Center(child: CircularProgressIndicator()),
|
||||
error: (error, stack) => Text(
|
||||
'데이터를 불러올 수 없습니다',
|
||||
style: AppTypography.body2(isDark),
|
||||
),
|
||||
error: (error, stack) =>
|
||||
Text('데이터를 불러올 수 없습니다', style: AppTypography.body2(isDark)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -301,26 +305,19 @@ class VisitStatistics extends ConsumerWidget {
|
||||
color: color.withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: color,
|
||||
size: 20,
|
||||
),
|
||||
child: Icon(icon, color: color, size: 20),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
label,
|
||||
style: AppTypography.caption(isDark),
|
||||
),
|
||||
Text(label, style: AppTypography.caption(isDark)),
|
||||
Text(
|
||||
value,
|
||||
style: AppTypography.body1(isDark).copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
style: AppTypography.body1(
|
||||
isDark,
|
||||
).copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -328,4 +325,4 @@ class VisitStatistics extends ConsumerWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user