Flutter와 네이티브의 연결고리 — Platform Channel 실전 입문
·
Flutter
Flutter는 강력한 UI 프레임워크지만, 때로는 네이티브(Android 또는 iOS)의 기능이 꼭 필요할 때가 있다.예를 들어 배터리 잔량을 가져오거나, 기기의 고유 센서를 사용해야 하는 경우 말이다.이럴 때 등장하는 게 바로 Platform Channel이다.이 글에서는 Flutter에서 네이티브 기능을 호출하는 구조인 Platform Channel을Android (Kotlin)과 iOS (Swift) 기준으로 차근차근 설명해 보겠다.📦 Platform Channel 구조 이해하기Platform Channel은 Flutter ↔ Native 간의 통신을 위해 사용되며, 세 가지 주요 타입이 있다:MethodChannel: 단방향 또는 요청-응답 방식EventChannel: 스트림 방식 (ex. 센..