Skip to content

Multiplatform

Letting a Decompose BLoC Render Itself

I use Decompose to manage navigation in my Kotlin Multiplatform projects. It does a great job of modeling navigation as a tree of business logic components (BLoCs) that are completely platform- and UI-agnostic. But that agnosticism comes with a small tax: something, somewhere, still has to decide which composable to draw for each BLoC. This post is about how I got rid of that boilerplate by giving each BLoC the ability to render itself since Chef Mate uses Compose Multiplatform to render its UI.

Kotlin Multiplatform UI Text Models With TextData

One practice I picked up at Square was separating business logic from the UI through a text model — a sealed class that abstracts whether displayed text comes from a fixed string, a string resource, or a formatted string. This creates a clean separation of concerns between business logic and presentation logic.

Chef Mate

Image title

Chef Mate is an open source Kotlin Multiplatform recipe keeper, meal planner, and grocery list app that targets Android, iOS, and JVM (Windows, Mac, and Linux).

Extending Kotlin Inject Anvil for Assisted Factories

Image title

I recently started using Kotlin inject anvil in my kotlin multiplatform (KMP) projects for dependency injection. However when using assisted injection I noticed myself writing boilerplate code to bind assisted factory method interfaces. In the process of trying to not write all this boiler plate code, I ended up writing a library that extends kotlin inject anvil to generate the code necessary to bind the assisted factory interface. Learn how to use this extension to bind assisted factory method interfaces.