CraftDSwiftUI 1.0.1

CraftDSwiftUI 1.0.1

Maintained by Rodrigo Vianna.



  • By
  • Rodrigo Vianna

Android API kotlin License MIT


CraftD: A framework to implement Server-Driven UI quickly and easily to Android / iOS / Flutter / Kmp

Documentation

See the project website for documentation.

Features

🔗 Compatibility

Tech Support
View System - Android Supported
Jetpack Compose - Android Supported
Widget - Flutter Supported
SwiftUi - iOS Supported
Jetpack Compose - Multiplatform ⚒️ In Progress

Components that already exist in the library

Component Compose View System Widget SwiftUI
Button X X X -
Text X X X X
CheckBox X - - -

Create your custom component( android compose example )

@JsonIgnoreProperties(ignoreUnknown = true)
@Immutable
@Stable
data class CheckBoxProperties(
    @JsonProperty("text") val text: String? = null,
    ... rest of your properties
)

Add your Component json object in Dymanic.json

{
  "key": "CraftDCheckBox",
  "value": {
    ... rest of your properties
  }
}

Create your Component

@Composable
fun CraftDCheckBox(
    checkboxProperties: CheckBoxProperties,
    modifier: Modifier = Modifier,
    onChecked: (Boolean) -> Unit
) {
    ... Rest of your code
}

Create your Component Builder

class CraftDCheckBoxBuilder(
    override val key: String = CraftDComponentKey.CHECK_BOX_COMPONENT.key
) :
    CraftDBuilder {
    @Composable
    override fun craft(model: SimpleProperties, listener: CraftDViewListener) {
        val checkBoxProperties = model.value.convertToVO<CheckBoxProperties>()
        CraftDCheckBox(checkBoxProperties) {
            checkBoxProperties.actionProperties?.let { listener.invoke(it) }
        }
    }
}

More details check our documentation

Samples

Android Compose Android View System iOS SwiftUI Flutter
android android iOS flutter

Credits

A Server Driven UI library for Android.

Inspired by the DynamicView.