Last active
April 19, 2022 19:08
-
-
Save 5AbhishekSaxena/0a1e18dfa61af3bdded939187f27a43e to your computer and use it in GitHub Desktop.
UiImage using Sealed Classes
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
sealed class UiImage { | |
data class LocalImage(val imageRes: Int) : UiImage() | |
data class RemoteImage(val imageUrl: String) : UiImage() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better approach: https://gist.github.com/5AbhishekSaxena/33df7096adc59ca624f30ecee9d634e0