feat: SMS 스캔 패키지를 flutter_sms_inbox로 변경 및 플랫폼별 최적화
- telephony 패키지를 flutter_sms_inbox로 교체 - 플랫폼별 SMS 스캔 로직 구현: * Web: mock data 사용 * Android: flutter_sms_inbox로 실제 SMS 스캔 * iOS: SMS 기능 비활성화 - iOS에서 SMS 스캔 버튼 숨김 처리 - PlatformHelper 유틸리티 추가로 웹 환경 오류 해결 - Android 네이티브 MethodChannel 코드 제거
This commit is contained in:
24
lib/utils/platform_helper.dart
Normal file
24
lib/utils/platform_helper.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
class PlatformHelper {
|
||||
static bool get isWeb => kIsWeb;
|
||||
|
||||
static bool get isIOS {
|
||||
if (kIsWeb) return false;
|
||||
return defaultTargetPlatform == TargetPlatform.iOS;
|
||||
}
|
||||
|
||||
static bool get isAndroid {
|
||||
if (kIsWeb) return false;
|
||||
return defaultTargetPlatform == TargetPlatform.android;
|
||||
}
|
||||
|
||||
static bool get isMobile => isIOS || isAndroid;
|
||||
|
||||
static bool get isDesktop {
|
||||
if (kIsWeb) return false;
|
||||
return defaultTargetPlatform == TargetPlatform.linux ||
|
||||
defaultTargetPlatform == TargetPlatform.macOS ||
|
||||
defaultTargetPlatform == TargetPlatform.windows;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user