@@ -8,18 +8,24 @@ import androidx.compose.material3.MaterialTheme
8
8
import androidx.compose.material3.Surface
9
9
import androidx.compose.material3.Text
10
10
import androidx.compose.runtime.Composable
11
+ import androidx.compose.runtime.collectAsState
12
+ import androidx.compose.runtime.getValue
11
13
import androidx.compose.ui.Alignment
12
14
import androidx.compose.ui.Modifier
13
15
import androidx.compose.ui.tooling.preview.Preview
14
16
import androidx.compose.ui.unit.sp
17
+ import androidx.hilt.navigation.compose.hiltViewModel
15
18
import com.foke.together.presenter.ui.theme.FourCutTogetherTheme
19
+ import com.foke.together.presenter.viewmodel.HomeViewModel
16
20
17
21
@Composable
18
22
fun HomeScreen (
19
23
navigateToCamera : (String ) -> Unit ,
20
24
navigateToSetting : (String ) -> Unit ,
21
- popBackStack : () -> Unit
25
+ popBackStack : () -> Unit ,
26
+ viewModel : HomeViewModel = hiltViewModel()
22
27
) {
28
+ val sampleData by viewModel.getSampleText().collectAsState()
23
29
24
30
Column (
25
31
modifier = Modifier .fillMaxWidth(),
@@ -33,6 +39,7 @@ fun HomeScreen(
33
39
Button (onClick = { navigateToSetting(" Setting" ) }){
34
40
Text (" Setting" )
35
41
}
42
+ Text (text = sampleData.sampleText)
36
43
}
37
44
}
38
45
0 commit comments