Skip to content

Instantly share code, notes, and snippets.

@sergicastellsague
Last active January 25, 2022 07:08
Show Gist options
  • Save sergicastellsague/47443bb971afcaef4182027b305a1c9a to your computer and use it in GitHub Desktop.
Save sergicastellsague/47443bb971afcaef4182027b305a1c9a 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