I am discovering android Jetpack Compose (and Navigation) and try to display a preview of a view with a navController
as parameter.
To achieve this, I use the PreviewParameter
and I have no error, but nothing is displayed in the Preview window.
Does anyone know how pass a fake NavController
instance to a Composable?
class FakeNavController : PreviewParameterProvider<NavController> {
override val values: Sequence<NavController>
get() {}
}
@Preview
@Composable
fun Preview(
@PreviewParameter(FakeNavController::class) fakeNavController: NavController
) {
HomeView(fakeNavController)
}