Skip to content

Instantly share code, notes, and snippets.

@kururu-abdo
Forked from sergicastellsague/service.kt
Created January 25, 2022 07:08
Show Gist options
  • Save kururu-abdo/a6aa56d89ea2bcf97fbe733340cda713 to your computer and use it in GitHub Desktop.
Save kururu-abdo/a6aa56d89ea2bcf97fbe733340cda713 to your computer and use it in GitHub Desktop.
private fun createNativeView(handle: Long) {
FlutterMain.ensureInitializationComplete(this, arrayOf())
val nativeView = FlutterNativeView(this, true)
val callback = FlutterCallbackInformation.lookupCallbackInformation(handle)
nativeView.runFromBundle(FlutterRunArguments().apply {
bundlePath = FlutterMain.findAppBundlePath(this@Service)
libraryPath = callback.callbackLibraryPath
entrypoint = callback.callbackName
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment