fix(calendar): 추천 기록 삭제 확인 팝업 및 SafeArea 적용
- recommendation_record_card: 삭제 전 확인 팝업 추가 - calendar_screen: 상세보기 BottomSheet에 SafeArea 적용 - 안드로이드 네비게이션 바에 버튼이 가려지는 문제 해결
This commit is contained in:
@@ -586,9 +586,11 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
||||
final recoTime = recommendationRecord?.recommendationDate;
|
||||
final isVisitConfirmed = visitRecord?.isConfirmed == true;
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 20),
|
||||
child: Column(
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 20),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -689,7 +691,8 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
||||
label: const Text('추천 방문 기록으로 저장'),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -27,6 +27,33 @@ class RecommendationRecordCard extends ConsumerWidget {
|
||||
return '$hour:$minute';
|
||||
}
|
||||
|
||||
Future<void> _showDeleteConfirmation(BuildContext context) async {
|
||||
final confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: const Text('추천 기록 삭제'),
|
||||
content: const Text('이 추천 기록을 삭제하시겠습니까?'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('취소'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: AppColors.lightError,
|
||||
),
|
||||
child: const Text('삭제'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
if (confirmed == true) {
|
||||
onDelete();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
@@ -166,7 +193,7 @@ class RecommendationRecordCard extends ConsumerWidget {
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: TextButton(
|
||||
onPressed: onDelete,
|
||||
onPressed: () => _showDeleteConfirmation(context),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: Colors.redAccent,
|
||||
padding: const EdgeInsets.only(top: 6),
|
||||
|
||||
Reference in New Issue
Block a user