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)
- producer install=platform (build the Kotlin Multiplatform code)
- producer install=library (generate Flutter - Kotlin glue)
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< consumer producerTask> ? tasks]) → Set<Task> - 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.
-
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/klutter.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}) → void producer - Overwrite the method channel Kotlin Class in src/main/kotlin.
-
writeBuildGradleFile(
{required String pathToAndroid, required String packageName, 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.