1
- [ <img src =" https://github.com/buijs-dev/klutter-dart/blob/main/logo_animated.gif?raw=true " width =" 300 " alt =" buijs software logo " />] ( https://github.com/buijs-dev )
2
-
3
- # Klutter
4
1
[ ![ GitHub license] ( https://img.shields.io/github/license/buijs-dev/klutter-dart?color=black&logoColor=black&style=for-the-badge )] ( https://github.com/buijs-dev/klutter-dart/blob/main/LICENSE )
5
2
[ ![ pub] ( https://img.shields.io/pub/v/klutter?style=for-the-badge )] ( https://pub.dev/packages/klutter )
6
3
[ ![ codecov] ( https://img.shields.io/codecov/c/github/buijs-dev/klutter-dart?logo=codecov&style=for-the-badge )] ( https://codecov.io/gh/buijs-dev/klutter-dart )
7
4
[ ![ CodeScene Code Health] ( https://img.shields.io/badge/CODESCENE-10-brightgreen?style=for-the-badge )] ( https://codescene.io/projects/27237 )
8
5
6
+ <br >
7
+
8
+ <img src =" https://github.com/buijs-dev/klutter/blob/develop/.github/assets/metadata/icon/klutter_logo.png?raw=true " alt =" buijs software logo " />
9
+
9
10
The Klutter Framework makes it possible to write a Flutter plugin for both Android
10
11
and iOS using [ Kotlin Multiplatform] ( https://kotlinlang.org/docs/multiplatform.html ) .
11
12
Instead of writing platform specific code twice in 2 languages (Swift + Kotlin),
@@ -24,12 +25,13 @@ Use this plugin if you want to:
24
25
1 . [ Installation] ( #Installation )
25
26
2 . [ Using plugins] ( #Usage )
26
27
3 . [ Creating plugins] ( #Creation )
28
+ 4 . [ FAQ!] ( #Faq! )
27
29
28
30
For a step-by-step guide, see the battery app with Klutter [ tutorial] ( https://buijs.dev/klutter-2/ ) .
29
31
30
32
# Installation
31
33
<b >What's the point?</b ></br >
32
- Plugins build with the Klutter Framework work slightly different than regular plugins.
34
+ Plugins build with the Klutter Framework work slightly different from regular plugins.
33
35
The Klutter dependency is a requirement for both using and creating plugins with Klutter.
34
36
35
37
<b >Steps:</b ></br >
@@ -48,14 +50,14 @@ flutter pub get
48
50
49
51
# Usage
50
52
<b >What's the point?</b ></br >
51
- Plugins build with the Klutter Framework work slightly different than regular plugins.
53
+ Plugins build with the Klutter Framework work slightly different from regular plugins.
52
54
The following tasks help Flutter to locate Klutter plugins
53
55
and ensure compatibility between Flutter Android/IOS configuration and Klutter plugin Android/IOS configuration.
54
56
55
57
<b >Steps:</b ></br >
56
58
1 . Installation.
57
- 3 . Initialization.
58
- 4 . Add dependencies.
59
+ 2 . Initialization.
60
+ 3 . Add dependencies.
59
61
60
62
Install Klutter as dependency as described [ here] ( #Installation ) .
61
63
@@ -65,8 +67,8 @@ Initialize Klutter in your project by running:
65
67
flutter pub run klutter:consumer init
66
68
```
67
69
68
- The init task will setup Klutter for both Android and iOS.
69
- Alternatively you can setup Android and IOS separately.
70
+ The init task will set up Klutter for both Android and iOS.
71
+ Alternatively you can set up Android and IOS separately.
70
72
71
73
Setup Android by running:
72
74
@@ -80,7 +82,7 @@ Setup IOS by running:
80
82
flutter pub run klutter:consumer init=ios
81
83
```
82
84
83
- Finally Klutter plugins can be added by running the add command.
85
+ Finally, Klutter plugins can be added by running the add command.
84
86
85
87
<B >Example</B >:</br > Add the library 'awesome_plugin' to your project:
86
88
@@ -174,4 +176,34 @@ flutter pub run klutter:producer install=library
174
176
```
175
177
176
178
Now test the plugin by following the steps outlined [ here] ( #Usage ) in the root/example project.
177
- When done you can run the example project from the root/example/lib folder and see your first plugin in action!
179
+ When done you can run the example project from the root/example/lib folder and see your first plugin in action!
180
+
181
+ # Faq!
182
+ 1 . [ App won't start on...] ( #App%20won't%20start )
183
+
184
+ ## App won't start
185
+
186
+ Make sure you have followed all the following steps:
187
+ - flutter create <your_plugin_name> --org <your_organisation> --template=plugin --platforms=android,ios.
188
+ - [ klutter] ( https://pub.dev/packages/klutter ) is added to the dependencies in your pubspec.yaml
189
+ (both the plugin and plugin/example for testing).
190
+ - do flutter pub get in both root and root/example folder.
191
+ - do flutter pub run klutter: producer init in the root folder.
192
+ - do flutter pub run klutter: producer install=library in the root folder.
193
+ - do flutter pub run klutter: producer install=platform in the root folder.
194
+ - do flutter pub run klutter: consumer init in the root/example folder.
195
+ - do flutter pub run klutter: consumer add=<your_plugin_name> in the root/example folder.
196
+
197
+ ### For Android emulator:
198
+ There should be a .klutter-plugins file in the root/example folder containing an entry for your plugin.
199
+ If not then do flutter pub run klutter: consumer add=<your_plugin_name> in the root/example folder again.
200
+
201
+ There should be a platform.aar file in the root/android/klutter folder. If not then do flutter pub run
202
+ klutter: producer install=platform from the root folder.
203
+
204
+ ### For iOS simulator:
205
+ There should be a Platform.xcframework folder in root/ios/Klutter. If not then do flutter pub run
206
+ klutter: producer install=platform from the root folder.
207
+
208
+ If there's an error message saying unable to find plugin or similar then run pod update in the root/example/ios
209
+ folder.
0 commit comments