Last active
May 9, 2024 17:18
-
-
Save binayshaw7777/9809abf6f9afbe37190c1b6dc50136b5 to your computer and use it in GitHub Desktop.
CommonMain App code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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