feat(permissions): add SMS permission screen and settings button; route from splash on Android
This commit is contained in:
@@ -2,6 +2,8 @@ import 'dart:async';
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/app_colors.dart';
|
||||
import '../services/sms_service.dart';
|
||||
import '../utils/platform_helper.dart';
|
||||
import '../routes/app_routes.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
|
||||
@@ -98,9 +100,20 @@ class _SplashScreenState extends State<SplashScreen>
|
||||
}
|
||||
}
|
||||
|
||||
void navigateToNextScreen() {
|
||||
// 앱 잠금 기능 비활성화: 항상 MainScreen으로 이동
|
||||
// 모든 이전 라우트를 제거하고 홈으로 이동
|
||||
Future<void> navigateToNextScreen() async {
|
||||
// Android에서 SMS 권한이 없으면 권한 안내 화면으로 이동
|
||||
if (PlatformHelper.isAndroid) {
|
||||
final hasPermission = await SMSService.hasSMSPermission();
|
||||
if (!hasPermission && mounted) {
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
AppRoutes.smsPermission,
|
||||
(route) => false,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mounted) return;
|
||||
Navigator.of(context).pushNamedAndRemoveUntil(
|
||||
AppRoutes.main,
|
||||
(route) => false,
|
||||
|
||||
Reference in New Issue
Block a user