Created
January 4, 2026 08:58
-
-
Save skydoves/93c8ede748692c4eb8f53e3bbe948931 to your computer and use it in GitHub Desktop.
Landscapist: Expect/Actual Pattern
This file contains hidden or 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
| // commonMain: Define expected interface | |
| expect fun createPlatformLandscapist(): Landscapist | |
| // androidMain: Provide Android implementation | |
| actual fun createPlatformLandscapist(): Landscapist { | |
| return Landscapist.builder(applicationContext) | |
| .config(LandscapistConfig(diskCacheSize = 200 * 1024 * 1024L)) | |
| .build() | |
| } | |
| // iosMain: Provide iOS implementation | |
| actual fun createPlatformLandscapist(): Landscapist { | |
| return Landscapist.getInstance() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment