목록flutter eventchannel (1)
Foggy day

이번 포스팅에서는 EventChannel에 대해 알아보겠습니다. EventChannel(이벤트채널)이란? - 이벤트 채널은 플랫폼들이 이벤트 스트림을 사용해서 통신하는 방법입니다. 데이터 전송 방향은 Native -> Flutter입니다. 1. Dart EventChannel 2. Android EventChannel 1. Dart EventChannel 먼저 Dart 코드에서 이벤트 채널(스트림)을 등록해 보겠습니다. EventChannel 클래스를 생성해야 하는데 이때 생성자에 채널명을 넣어주세요. EventChannel 클래스의 receiveBroadcastStream 함수의 리턴 타입은 Stream이므로 listen 함수를 구현할 수 있습니다. listen 함수의 event에는 Native에서 전..
Flutter/Flutter 기타
2023. 8. 29. 00:06