Component - Room with Flow for reactive data
This UI component shows a list of items stored in a local database using Room. It uses Kotlin Flow to reactively update the list on the screen whenever the data changes, without needing manual refresh.
This UI component shows a list of items stored in a local database using Room. It uses Kotlin Flow to reactively update the list on the screen whenever the data changes, without needing manual refresh.
Activity
└── Scaffold (Material Design layout)
├── TopAppBar (Title bar)
└── Column (Vertical layout)
├── LazyColumn (Scrollable list)
│ └── ItemRow (Each item in list)
└── FloatingActionButton (Add new item button)Flow with Room in Android apps?fun getAllTasks(): Flow<List<Task>>
@Query("SELECT * FROM users")
fun getUsers(): List<User>1. DAO function: ? 2. Collect Flow in UI: ?
Pass the test and this pattern moves unknown