fix(calendar): 추천 기록 삭제 확인 팝업 및 SafeArea 적용
- recommendation_record_card: 삭제 전 확인 팝업 추가 - calendar_screen: 상세보기 BottomSheet에 SafeArea 적용 - 안드로이드 네비게이션 바에 버튼이 가려지는 문제 해결
This commit is contained in:
@@ -586,7 +586,9 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
|||||||
final recoTime = recommendationRecord?.recommendationDate;
|
final recoTime = recommendationRecord?.recommendationDate;
|
||||||
final isVisitConfirmed = visitRecord?.isConfirmed == true;
|
final isVisitConfirmed = visitRecord?.isConfirmed == true;
|
||||||
|
|
||||||
return Padding(
|
return SafeArea(
|
||||||
|
top: false,
|
||||||
|
child: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(16, 12, 16, 20),
|
padding: const EdgeInsets.fromLTRB(16, 12, 16, 20),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
@@ -691,6 +693,7 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen>
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
loading: () => const SizedBox(
|
loading: () => const SizedBox(
|
||||||
|
|||||||
@@ -27,6 +27,33 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
return '$hour:$minute';
|
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
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||||
@@ -166,7 +193,7 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
onPressed: onDelete,
|
onPressed: () => _showDeleteConfirmation(context),
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
foregroundColor: Colors.redAccent,
|
foregroundColor: Colors.redAccent,
|
||||||
padding: const EdgeInsets.only(top: 6),
|
padding: const EdgeInsets.only(top: 6),
|
||||||
|
|||||||
Reference in New Issue
Block a user