Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created June 24, 2019 08:13
Show Gist options
  • Save sbis04/f660e5d2798b03d9e0d2926924acf3cb to your computer and use it in GitHub Desktop.
Save sbis04/f660e5d2798b03d9e0d2926924acf3cb to your computer and use it in GitHub Desktop.
flutter_os_main_activity
class MainActivity: FlutterActivity(), AmbientMode.AmbientCallbackProvider {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
// Wire up the activity for ambient callbacks
AmbientMode.attachAmbientSupport(this)
}
override fun getAmbientCallback(): AmbientMode.AmbientCallback {
return FlutterAmbientCallback(getChannel(flutterView))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment