Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created January 4, 2026 08:58
Show Gist options
  • Select an option

  • Save skydoves/93c8ede748692c4eb8f53e3bbe948931 to your computer and use it in GitHub Desktop.

Select an option

Save skydoves/93c8ede748692c4eb8f53e3bbe948931 to your computer and use it in GitHub Desktop.
Landscapist: Expect/Actual Pattern
// 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