producer topic

In Klutter terminology a producer is a project for creating (producing) a plugin with Klutter.

A producer project is basically a Flutter plugin project with an extra Kotlin Multiplatform module where all (native) platform code will be written.

The following producer tasks are available:

  • producer init (initialize Klutter in your project)

Classes

Gradle producer gradle
Copy Gradle files to root and root/android folders to enable the usage of Gradle.
ProducerInit producer
Task to run project initialization (setup).

Functions

addFrameworkToPodspec({required String pathToIos, required String pluginName}) → void producer
Edit the root/ios/
allTasks([List<Task>? tasks]) Set<Task> consumer producer
List of all Task objects.
createIosKlutterFolder(String pathToIos) → void producer
Overwrite the build.gradle file in the root/android folder.
createPlatformModule({required String pathToRoot, required String pluginName, required String packageName}) → void producer
Generate the Kotlin Multiplatform module.
deleteRootAndroidManifestFile({required String pathToAndroid}) → void producer
Delete the root/android/src/main/AndroidManifest.xml File because it is only used to set the package name, which is not supported from AGP 8.0+.
findDependencyPath({required String pathToSDK, required String pathToRoot, required String pluginName}) String consumer producer
Get the relative path of a plugin dependency.
findKlutterBomVersion(String pathToRoot) String? consumer producer
Find the version of klutter bill-of-materials in root/kradle.yaml or return null.
findPackageName(String pathToRoot) String consumer producer
Find package name in root/pubspec.yaml.
findPluginName(String pathToRoot) String consumer producer
Find plugin name in root/pubspec.yaml.
findPluginVersion(String pathToRoot) String consumer producer
Find plugin name in root/pubspec.yaml.
toPluginClassName(String pluginName, {bool postfixWithPlugin = false}) String consumer producer
The plugin ClassName which is equal to the library name converted to camelcase + 'Plugin' postfix if postfixWithPlugin is set to true.
writeAndroidPlugin({required String pathToAndroid, required String packageName, required String pluginName}) → void producer
Overwrite the method channel Kotlin Class in src/main/kotlin.
writeBuildGradleFile({required String pathToAndroid, required String packageName, required String pluginName, required String pluginVersion, required String klutterBomVersion}) → void producer
Overwrite the build.gradle file in the root/android folder.
writeExampleMainDartFile({required String pathToExample, required String pluginName}) → void producer
Generate the main.dart file in the root/example/lib folder.
writeGradleProperties(String pathToRoot) → void producer gradle
Generate the build.gradle.kts file in the root folder.
writeKlutterGradleFile(String pathToAndroid) → void producer
Create the android/klutter folder if it does not exist.
writeRootBuildGradleFile({required String pathToRoot, required String pluginName, required String klutterBomVersion}) → void producer gradle
Generate the build.gradle.kts file in the root folder.
writeRootSettingsGradleFile({required String pathToRoot, required String pluginName}) → void producer gradle
Generate the settings.gradle.kts file in the root folder.

Enums

ScriptName consumer producer
List of available scripts.
ScriptOption consumer producer
List of available scripts options.