Skip to content

Instantly share code, notes, and snippets.

@vreamer
Created August 26, 2020 08:12
Show Gist options
  • Save vreamer/59d7b0571fd2c8311ad4357a63200120 to your computer and use it in GitHub Desktop.
Save vreamer/59d7b0571fd2c8311ad4357a63200120 to your computer and use it in GitHub Desktop.
Show new idea
package com.example.direct_reply_notification
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodChannel
object NativeMethodChannel {
private const val CHANNEL_NAME = "channel"
private lateinit var methodChannel: MethodChannel
fun configureChannel(flutterEngine: FlutterEngine) {
methodChannel = MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL_NAME)
}
// add the following method, it passes a string to flutter
fun showNewIdea(idea: String) {
methodChannel.invokeMethod("showNewIdea", idea)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment