Klutter plugin makes it possible to write a Flutter plugin for both Android and iOS using Kotlin only.

Overview

GitHub license Codecov

The Klutter Framework makes it possible to write a Flutter plugin for both Android and iOS using Kotlin Multiplatform. Instead of writing platform specific code twice in 2 languages (Swift + Kotlin), it can be written once in Kotlin and used as a Flutter plugin.

Important: Klutter is in alpha and not yet published to PUB.

Getting started

Installation

Add the Klutter library to dev_dependencies in the pubspec.yaml:

dev_dependencies:
  klutter: ^0.1.0

Then run:

flutter pub get

Use plugins

Plugins build with the Klutter Framework work slightly different than regular plugins. First install the dev dependency. Next run the android command to setup Gradle:

flutter pub run klutter:android

This task will do 3 things for your Flutter project:

  • Create a .klutter-plugins file in the root folder.
  • Create a new Gradle file in the flutter/packages/flutter_tools/gradle.
  • Update the android/settings.gradle file to apply the newly generated Gradle file.

The .klutter-plugins file will register all Klutter made plugins used in your project. The created Gradle file in the flutter_tools manages the plugins and enables them to be found by the Flutter project.

That's it! Now you can use plugins made with Klutter in your Flutter application by adding them to the dependencies in the pubspec.yaml. Register it in your project by running klutter:add. For example to add the library 'awesome_plugin' to your project run:

flutter pub run klutter:add awesome_plugin  

This will add the awesome_plugin to the .klutter-plugins file.

Create plugins

Start by creating a new Flutter plugin project. You can do this using the wizard in Android Studio or by running the following command, substituting 'org.example' with your organisation name and 'plugin_name' with your plugin name.

flutter create --org com.example --template=plugin --platforms=android,ios plugin_name

Then install the dev dependency. //TODO continue

You might also like...

A Basic Currency Converter made for both iOS and Android using the flutter.io platform

FlutterCurrencyConverter A Basic Currency Converter made for both iOS and Android using the flutter.io platform This app uses the ExchangeRate-API for

Nov 23, 2022

TicTacToe Using flutter. For both android and ios

mt_tictactoe A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Nov 27, 2022

A mobile application for both android and ios made for work out and fitness purpose

A mobile application for both android and ios made for work out and fitness purpose

It's a mobile application for both android and ios made for work out and fitness purpose with many features you can read about here, but it can be used under all subject you want, well architected code and organized !

Dec 18, 2022

Telnyx flutter - A Flutter package for both android and iOS which helps developers with Telnyx API services

Telnyx Flutter A Flutter package for both android and iOS which helps developers

Jan 23, 2022

A Flutter Accident reporting App working in both iOS and Android

Flutter Accident Reporting App A Flutter Accident reporting App working in both iOS and Android.This project total size of all Dart files is 4714 bite

Oct 13, 2022

πŸ’³ A Flutter package for making payments via credo central. Provides support for both Android and iOS

πŸ’³ Credo Package for Flutter TODO: Put a short description of the package here that helps potential users know whether this package might be useful fo

Dec 26, 2021

A horoscope forecasting application for both Android and iOS

A horoscope forecasting application for both Android and iOS

Zodoscope A Horoscope Forcasting Application Built with Flutter, for Android and iOS API used: http://horoscope-api.herokuapp.com/ Key Features All Zo

Sep 25, 2022

This project was writed with pure dart code,which means it's support both iOS and Android.

This project was writed with pure dart code,which means it's support both iOS and Android.

This project was writed with pure dart code,which means it's support both iOS and Android. Screenshot Todo show/hide animation Usage You can find the

Dec 24, 2022

Notefy - Task Saving App for both Android and iOS

Assignment for Flutter Developers Goal of the assignment is to: - Show the capa

Jan 25, 2022
Comments
  • lib not found

    lib not found

    I tried everything in https://buijs.dev/klutter-2/ for setting up my project but I get an error on latest flutter/dart when running flutter pub run klutter:producer init

    I tried alot of stuff but the problem remains the same

    ` ════════════════════════════════════════════ KLUTTER (v0.2.4) ════════════════════════════════════════════

    This might take a while. Just a moment please... Unhandled exception: FileSystemException: Exists failed, path = '\D:\flutter\test_klutter\lib' (OS Error: The filename, directory name, or volume label syntax is incorrect. , errno = 123) #0 _Directory.existsSync (dart:io/directory_impl.dart:94:7) #1 FileUtil.maybeDelete (package:klutter/src/common/utilities.dart:60:9) #2 _extension#0.setupRoot (package:klutter/src/cli/task_producer_init.dart:53:27) #3 ProducerInit.toBeExecuted (package:klutter/src/cli/task_producer_init.dart:41:7) #4 Task.execute (package:klutter/src/cli/task.dart:52:7) #5 execute (package:klutter/src/cli/cli.dart:107:27) #6 main (file:///D:/flutter/flutter_windows_3.3.6-stable/flutter/.pub-cache/hosted/pub.dartlang.org/klutter-0.2.4/bin/producer.dart:40:24) #7 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:295:32) #8 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12) pub finished with exit code 255`

    opened by DjToMeK30 5
Releases(v0.2.3)
  • v0.2.3(Aug 26, 2022)

  • v0.2.0(Aug 25, 2022)

    • Changed gradle plugin id to dev.buijs.klutter
    • Uses Klutter Gradle v2022.r6-8.alpha.
    • New project template uses Klutter DSL to apply Klutter dependencies.
    • Flutter generated files are removed from lib folder after klutter init.
    • Moved task klutterInstallPlatform from generated build.gradle.kts to Gradle plugin.
    • Renamed task klutterInstallPlatfrom to klutterBuild.
    • Moved task klutterCopyAarFile from generated build.gradle.kts to Gradle plugin.
    • Moved task klutterIosFramework from generated build.gradle.kts to Gradle plugin.
    • Changed platform build.gradle.kts to create an XCFramework instead of fat framework for iOS.
    • Bugfix App does not work on Mac M1.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Jul 2, 2022)

  • v0.1.2(Jul 1, 2022)

    • Uses Klutter Gradle v2022.r6-6.alpha.
    • Added adapter library with improved AdapterResponse class.
    • As of 0.1.2 Klutter is required as dependency instead of dev_dependency.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Jun 29, 2022)

  • v0.1.0(Jun 27, 2022)

    • Uses Klutter Gradle v2022.r6.alpha.
    • Initial version with iOS and Android support.
    • Contains the tasks:
      • klutter:consumer init
      • klutter:consumer init=android
      • klutter:consumer init=android,ios
      • klutter:producer init
      • klutter:producer install=platform
      • klutter:producer install=library
    Source code(tar.gz)
    Source code(zip)
Owner
Gillian
Full stack developer Java | Kotlin | Dart - Flutter | Klutter!
Gillian
Makes it possible to safely execute and retry a Future inside a StatelessWidget

futuristic Makes it possible to safely execute and retry a Future inside a StatelessWidget. See the Mainstream package for a similar API for working w

Martin Rybak 28 Sep 15, 2022
Write iOS&Android Code using Dart. This package liberates you from redundant glue code and low performance of Flutter Channel.

Dart_Native Dart_Native operates as both a code generator tool and a bridge to communicate between Dart and native APIs. Replaces the low-performing F

DartNative 893 Jan 4, 2023
Encode App-Dev is a open source project which contains different projects of Application development, Android development, IOS development, Flutter, Kotlin, Dart, Java, Swift etc.

HACKTOBERFEST 2022 Encode App-Dev is an open source project which contains different projects of Application development, Android development, IOS dev

null 4 Dec 4, 2022
Flutterbodydetection - A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmentation APIs for both static images and live camera stream.

body_detection A flutter plugin that uses MLKit on iOS/Android platforms to enable body pose and mask detection using Pose Detection and Selfie Segmen

null 18 Dec 5, 2022
Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_local_notifications plugin.

Flutter Local Notifications Example Flutter Local Notifications - Learn how to implement local notifications into both Android and iOS using flutter_l

Sandip Pramanik 12 Nov 29, 2022
A Flutter plugin to get location updates in the background for both Android and iOS

Background Location A Flutter plugin to get location updates in the background for both Android and iOS (Requires iOS 10.0+). Uses CoreLocation for iO

Ali Almoullim 181 Jan 4, 2023
In this app, it's possible to find some different kind of flutter animations

flutter_animations Apprendre Γ  utiliser les animations avec Flutter Getting Started This project is a starting point for a Flutter application. A few

MOISE Rajesearison 0 Dec 24, 2021
Another breakpoint framework. Aims to simplify as much as possible building adaptive layouts.

Another breakpoint framework. Aims to simplify as much as possible building adaptive layouts. Features Really simple implementation Works with and wit

null 3 Sep 26, 2022
AdventOfCode 2022 in Dart focusing on code golf, making the solutions as small as possible

Advent of Code 2022 in Dart (Code Golf) This is my attempt at solving the Advent of Code 2022 puzzles in the shortest possible code using Dart 2.18. Y

Pascal Welsch 5 Dec 15, 2022