-
-
Save skydoves/6f16858957b3f39eb4ab1764c0c0760a to your computer and use it in GitHub Desktop.
composition_local_provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun PreviewProvider(content: @Composable () -> Unit) { | |
val localImageLoader = ImageLoder.getLocalImageLoader() | |
CompositionLocalProvider( | |
LocalImageLoader provides localImageLoader | |
) { | |
content() | |
} | |
} | |
@Preview | |
@Composable | |
private fun AvatarPreview() { | |
PreviewProvider { | |
UserAvatar() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment