封装BaseViewModel
This commit is contained in:
@@ -71,14 +71,14 @@ import taskttl.composeapp.generated.resources.total_tasks
|
||||
fun StatisticsScreen(
|
||||
navController: NavHostController,
|
||||
taskViewModel: TaskViewModel = koinViewModel(),
|
||||
countdownViewModel: CountdownViewModel = koinViewModel()
|
||||
countdownViewModel: CountdownViewModel = koinViewModel(),
|
||||
) {
|
||||
|
||||
val taskState by taskViewModel.state.collectAsState()
|
||||
val countdownState by countdownViewModel.state.collectAsState()
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
taskViewModel.handleIntent(TaskIntent.LoadTasks)
|
||||
taskViewModel.processIntent(TaskIntent.LoadTasks)
|
||||
countdownViewModel.handleIntent(CountdownIntent.LoadCountdowns)
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ private fun StatisticCard(
|
||||
value: String,
|
||||
icon: ImageVector,
|
||||
color: Color,
|
||||
modifier: Modifier = Modifier
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Card(
|
||||
modifier = modifier,
|
||||
@@ -264,7 +264,7 @@ private fun CategoryStatisticItem(
|
||||
category: Category,
|
||||
totalCount: Int,
|
||||
completedCount: Int,
|
||||
typeRes: StringResource
|
||||
typeRes: StringResource,
|
||||
) {
|
||||
if (totalCount == 0) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user