Created
January 18, 2021 21:00
-
-
Save rondinellimorais/65055963e0a2de7595dacb29a502c29f to your computer and use it in GitHub Desktop.
bridge_kotlin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.magic_gathering | |
import androidx.annotation.NonNull | |
import io.flutter.embedding.engine.FlutterEngine | |
import io.flutter.plugin.common.MethodChannel | |
class MainActivity: FlutterActivity() { | |
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { | |
super.configureFlutterEngine(flutterEngine) | |
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "magicgathering/bridge").setMethodCallHandler { call, result -> | |
when (call.method) { | |
"startUnityActivity" -> { | |
val cardBase64Image: String = call.argument<String>("cardBase64Image") as String | |
val cardsBase64Image: ArrayList<String> = call.argument<ArrayList<String>>("cardsBase64Image") as ArrayList<String> | |
// aqui fiz o startActivity da cena do unity | |
result.success(true) | |
} | |
else -> result.notImplemented() | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment