0Pricing
Kotlin Multiplatform Academy · Lesson

A Cross-Platform ViewModel Base

Hold state and a scope that both platforms can use.

Why Share the ViewModel?

A ViewModel holds screen state and logic. In KMP you write it once in shared code so both apps stay perfectly in sync. 🎉

Logic, Not Pixels

Your shared ViewModel decides what the screen shows. The native UI decides how to draw it. That split is the heart of KMP.

All lessons in this course

  1. A Cross-Platform ViewModel Base
  2. Expose UI State as StateFlow
  3. Handle User Intents & Actions
  4. Bind the ViewModel to Each UI
← Back to Kotlin Multiplatform Academy