fixing kotlin reference isue
This commit is contained in:
parent
5e3df961e6
commit
aad761dc3d
@ -19,7 +19,7 @@ import io.flutter.plugin.common.MethodCall
|
|||||||
import io.flutter.plugin.common.MethodChannel
|
import io.flutter.plugin.common.MethodChannel
|
||||||
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
import io.flutter.plugin.common.MethodChannel.MethodCallHandler
|
||||||
import io.flutter.plugin.common.MethodChannel.Result
|
import io.flutter.plugin.common.MethodChannel.Result
|
||||||
import io.flutter.plugin.common.PluginRegistry.Registrar
|
//import io.flutter.plugin.common.PluginRegistry.Registrar
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.FileOutputStream
|
import java.io.FileOutputStream
|
||||||
@ -40,11 +40,10 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
|
|||||||
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
|
// depending on the user's project. onAttachedToEngine or registerWith must both be defined
|
||||||
// in the same class.
|
// in the same class.
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun registerWith(registrar: Registrar) {
|
override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
|
||||||
|
val channel = MethodChannel(flutterPluginBinding.binaryMessenger, "photo_gallery")
|
||||||
val channel = MethodChannel(registrar.messenger(), "photo_gallery")
|
val channel = MethodChannel(registrar.messenger(), "photo_gallery")
|
||||||
val plugin = PhotoGalleryPlugin()
|
channel.setMethodCallHandler(PhotoGalleryPlugin())
|
||||||
plugin.context = registrar.activeContext()
|
|
||||||
channel.setMethodCallHandler(plugin)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const val imageType = "image"
|
const val imageType = "image"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user