Skip to content

Instantly share code, notes, and snippets.

@binayshaw7777
Last active May 9, 2024 17:18
Show Gist options
  • Select an option

  • Save binayshaw7777/9809abf6f9afbe37190c1b6dc50136b5 to your computer and use it in GitHub Desktop.

Select an option

Save binayshaw7777/9809abf6f9afbe37190c1b6dc50136b5 to your computer and use it in GitHub Desktop.
CommonMain App code
// This is your entry point for your CMP App
@Composable
fun App(
databaseBuilder: RoomDatabase.Builder<UserDatabase>
) {
MaterialTheme {
// Building the database
val database = remember { databaseBuilder.build() }
// Creating UserDao instance and passing in other screens
val userDao = remember { database.userDao() }
// This should be your rest of the UI code
MainContent(userDao)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment