Klutter is a framework which interconnects Flutter and Kotlin Multiplatform. It can be used to create Flutter plugins. This cookbook contains examples of both the platform (Kotlin) and ui (Flutter) code. All recipes are based on Klutter version 2024.1.3.beta.
Before following a recipe locally, you need to set up kradle by running the following command in the example:
./gradlew klutterGetKradle
Create a kradle.env file in the example root directory with the following content:
cache={{system.user.home}}/.kradle/cache/
output.path={{project.build}}/klutter
skip.codegen=false
protoc.url=https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-universal_binary.zip
In the root and root/android folder add local.properties with the following content:
sdk.dir=/path-to-your-android-sdk
flutter.sdk=/path-to-your-flutter-dist
You can then build the project simply by running:
./kradle build
The example app can be started from root/example/lib/main.dart.
Upgrading klutter is not always straightforward, due to its beta status. See migration guides for more information.