chore(app): 추천 기록 탭 대응과 스플래시 대기 제한
- RecommendationRecordCard에 onTap 콜백을 추가하고 카드 전체를 InkWell로 감싸 탭 제스처를 받을 수 있게 함\n- _navigateToHome에서 권한 요청 Future를 5초 타임아웃으로 감싸 스플래시에서 무한 대기를 막고, 완료 여부와 관계없이 홈으로 이동하도록 정리\n- 변경 의도 주석을 추가해 동작 맥락을 명시
This commit is contained in:
@@ -10,11 +10,15 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
final VoidCallback onConfirmVisit;
|
final VoidCallback onConfirmVisit;
|
||||||
final VoidCallback onDelete;
|
final VoidCallback onDelete;
|
||||||
|
|
||||||
|
/// 카드 전체 탭(tap) 시 실행할 콜백.
|
||||||
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
const RecommendationRecordCard({
|
const RecommendationRecordCard({
|
||||||
super.key,
|
super.key,
|
||||||
required this.recommendation,
|
required this.recommendation,
|
||||||
required this.onConfirmVisit,
|
required this.onConfirmVisit,
|
||||||
required this.onDelete,
|
required this.onDelete,
|
||||||
|
this.onTap,
|
||||||
});
|
});
|
||||||
|
|
||||||
String _formatTime(DateTime dateTime) {
|
String _formatTime(DateTime dateTime) {
|
||||||
@@ -43,6 +47,9 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12),
|
borderRadius: BorderRadius.circular(12),
|
||||||
),
|
),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: onTap,
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(16),
|
padding: const EdgeInsets.all(16),
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -101,7 +108,9 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(
|
Text(
|
||||||
_formatTime(recommendation.recommendationDate),
|
_formatTime(
|
||||||
|
recommendation.recommendationDate,
|
||||||
|
),
|
||||||
style: AppTypography.caption(isDark),
|
style: AppTypography.caption(isDark),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -119,7 +128,8 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
'추천만 받은 상태입니다. 방문 후 확인을 눌러 주세요.',
|
'추천만 받은 상태입니다. 방문 후 확인을 눌러 주세요.',
|
||||||
style: AppTypography.caption(isDark).copyWith(
|
style: AppTypography.caption(isDark)
|
||||||
|
.copyWith(
|
||||||
color: Colors.orange,
|
color: Colors.orange,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
@@ -169,6 +179,7 @@ class RecommendationRecordCard extends ConsumerWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
loading: () => const Card(
|
loading: () => const Card(
|
||||||
|
|||||||
@@ -247,13 +247,18 @@ class _SplashScreenState extends State<SplashScreen>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _navigateToHome() {
|
void _navigateToHome() {
|
||||||
|
// 권한 요청이 지연되어도 스플래시(Splash) 화면이 멈추지 않도록 최대 5초만 대기한다.
|
||||||
|
final permissionFuture = _ensurePermissions().timeout(
|
||||||
|
const Duration(seconds: 5),
|
||||||
|
onTimeout: () {},
|
||||||
|
);
|
||||||
|
|
||||||
Future.wait([
|
Future.wait([
|
||||||
_ensurePermissions(),
|
permissionFuture,
|
||||||
Future.delayed(AppConstants.splashAnimationDuration),
|
Future.delayed(AppConstants.splashAnimationDuration),
|
||||||
]).then((_) {
|
]).whenComplete(() {
|
||||||
if (mounted) {
|
if (!mounted) return;
|
||||||
context.go('/home');
|
context.go('/home');
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user