jeff
01/04/2022, 5:52 PM@Preview
? We normally use Moshi to deserialize but that doesn't seem to work in previews because codegen hasn't run. I could construct the resulting (post-deserialization) object manually, but the JSON has enough nesting that it's very cumbersome.mattinger
01/04/2022, 6:03 PMBradleycorn
01/04/2022, 7:53 PMval
in the same file where the model is defined. then whenever I need to preview a composable that uses that model, I can just use that val
. I’ve not gotten into the habit of just always creating a “preview val” every time I create a model, so I have it ready to go when I’m working with UI and need to write a preview. It’ also helps when I have a model that has complex/nested properties, because I can use their “preview vals” when constructing the higher level model’s “preview val”.