|
|
@@ -2,7 +2,9 @@ package com.atmob.keyboard_android.util.bridge
|
|
|
|
|
|
import com.atmob.keyboard_android.constant.PluginConfig
|
|
|
import com.atmob.keyboard_android.enums.FlutterMethod
|
|
|
-import com.atmob.keyboard_android.util.bridge.model.KeyboardListModel
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.base.EmptyResp
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.req.ChooseKeyboardReq
|
|
|
+import com.atmob.keyboard_android.util.bridge.model.resp.KeyboardListResp
|
|
|
import com.atmob.keyboard_android.util.bridge.util.FlutterMethodCaller
|
|
|
import com.atmob.keyboard_android.util.bridge.util.NativeMethodRegistry
|
|
|
import io.flutter.embedding.engine.FlutterEngineCache
|
|
|
@@ -35,12 +37,25 @@ object FlutterBridgeManager : IBridgeApi {
|
|
|
}
|
|
|
|
|
|
override fun getKeyboardList(
|
|
|
- onSuccess: (resultObj: KeyboardListModel) -> Unit,
|
|
|
+ onSuccess: (resultObj: KeyboardListResp) -> Unit,
|
|
|
onFail: (msg: String) -> Unit
|
|
|
) {
|
|
|
- mFlutterMethodCaller.callMethod<KeyboardListModel>(
|
|
|
+ mFlutterMethodCaller.callMethod<KeyboardListResp>(
|
|
|
FlutterMethod.GET_KEYBOARD_LIST.methodName,
|
|
|
- modelClazz = KeyboardListModel::class.java,
|
|
|
+ modelClazz = KeyboardListResp::class.java,
|
|
|
+ onSuccess = onSuccess,
|
|
|
+ onFail = onFail
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ override fun chooseKeyboard(
|
|
|
+ req: ChooseKeyboardReq,
|
|
|
+ onSuccess: (EmptyResp) -> Unit,
|
|
|
+ onFail: (String) -> Unit
|
|
|
+ ) {
|
|
|
+ mFlutterMethodCaller.callMethod<EmptyResp>(
|
|
|
+ FlutterMethod.CHOOSE_KEY_BOARD.methodName,
|
|
|
+ modelClazz = EmptyResp::class.java,
|
|
|
onSuccess = onSuccess,
|
|
|
onFail = onFail
|
|
|
)
|