Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- JPA
- MacOS
- Xcode
- rxswift
- Archive
- geofencing
- 이미지
- error
- darkmode
- 웹뷰
- Swift
- IOS
- UIButton
- Firebase
- Apple
- SwiftUI
- Git
- iOS16
- Notification
- 개발자
- Code
- appstore
- Realm
- FLUTTER
- view
- Session
- 한글
- github
- window
- mac
Archives
- Today
- Total
EEYatHo 앱 깎는 이야기
Flutter ) Kotlin 코드 호출할 때 파라미터 넘기기 - EEYatHo Flutter 본문
Flutter/Native 코드 호출
Flutter ) Kotlin 코드 호출할 때 파라미터 넘기기 - EEYatHo Flutter
EEYatHo 2022. 10. 28. 16:52반응형
Flutter -> Kotlin 전달
static const platform = MethodChannel('channelName');
var result = await platform.invokeMethod('methodName', <String, dynamic>{'param1': [1, 2], 'param2': "stringParam"});
Kotlin 에서 수신
flutterEngine?.dartExecutor?.let {
MethodChannel(it, 'channelName').setMethodCallHandler { call, result ->
if (call.method == "methodName") {
val param1 = call.argument<ArrayList<Int>>("param1")?.toIntArray
val param2 = call.argument<String>("param2")
}
}
}

'Flutter > Native 코드 호출' 카테고리의 다른 글
Flutter ) java.util.ArrayList - EEYatHo Flutter (0) | 2022.10.28 |
---|---|
Flutter ) Kotlin 코드 호출 - EEYatHo Flutter (0) | 2022.10.28 |