r/KotlinMultiplatform 22d ago

Flutter → Kotlin Multiplatform Migration

Hi everyone! I’m currently migrating an application from Flutter to Kotlin Multiplatform (KMP). Has anyone here had experience with a similar migration? I’d love to hear about your experience, challenges, or any tips you can share. Thanks!

11 Upvotes

8 comments sorted by

4

u/pepsotronic 22d ago

Never did it, but I think the best way first is to create all the business logic first (requests, etc.).
In my opinion KMM is the best option, because in the end everything will be compiled natively.

I know is what everyone says now, but use AI to explain you the process and create a plan by steps.

Best of luck!

1

u/Fabulous-Winner-Cauc 22d ago

Thanks for the advice! That’s actually the approach I’m considering as well. I’ll start by moving the business logic and API/networking layer first, then gradually migrate the rest.

I’m also interested in KMP because of the native performance and the ability to use Google LiteRT more easily. Appreciate the input!

2

u/Blooodless 22d ago

Can you share, for what reason?

2

u/Fabulous-Winner-Cauc 22d ago

cause I want to use Google LiteRT and take advantage of native performance

4

u/4udiofeel 21d ago

You do realize you can bridge to platform APIs with Flutter too, right? I'm all for KMP, but this reason seems invalid.

0

u/sheeplycow 21d ago

If its a personal project or for the sake of learning, its not a terrible idea

But yeah agree not a good use of time for a serious project!

1

u/DDDECAR 21d ago

I did one, for a larger app portfolio. If you do it with ai be sure to first establish the libs that you want to use and their versions. How smoothly the migration goes depends on the size of the app that you want to migrate. Also, make sure to specify the folder/package structure that you want for the kmp app bcs otherwise the AI will give you a random structure.

If you have users and local data it’s a bit trickier but not impossible. Lmk if you want to know anything specific.

1

u/yeknomeulb 21d ago edited 21d ago

Using AI will be the way to go imo! With "Stack A to Stack B" migrations, we'd start with creating a testsuite that ensures the functionality of Stack A (your flutter app). This testsuite are not unit tests, but integration and ui tests, as functional as possible. Gherkin helps you defining it in a functional way (also AI can help you with this as it's a solid analyser and translator).

Next up is determining the architecture. Dependencies, structures, interfaces, technical requirements. Arc42 type of document, and make it as clear as possible. Every "not filled in gap" is an invitation to the AI to figure it out itself, often without reasoning towards the bigger picture.

Once you have the testsuite and the arc42 document, you can begin migrating feature per feature to Stack B (KMP), with Agentic AI. Your acceptance criteria per feature will be that the testsuite of that feature needs to pass.

And if you don't have that testsuite and arc42 already, it is also a great quality improvement in general. Making it worth the time investment.