Duit is a backend side UI framework for Flutter. It is used for creating widgets and server-side state management.
The framework consists of several parts:
The framework ensures that the layout model is received from the server, interacts with the backend via the Action API, and embeds custom components into the widget hierarchy processing pipeline. Duit is flexible and extensible, which allows it to create rich UI dynamically.
The flutter_duit library depends on the duit_kernel package, which contains basic model definitions for implementing framework entities and developing third-party packages and extensions. Carefully study the version compatibility table if you are going to directly add duit_kernel to your project (needed to implement custom widgets and extensions).
Lib versions | Kernel versions |
---|---|
<= v1.5.0 | v1.0.1 |
>= v1.6.0 | v1.1.0 |
>= v1.7.0 | v1.1.1 |
>= v1.9.0 | v1.2.0 |
>= v1.11.0 | v1.3.0 |
>= v1.12.0 | v1.4.0 |
>= v2.0.0 | v2.0.1 |
>= v2.2.0 | v2.1.1 |
flutter pub add duit_kernel
It is responsible for displaying the UI, updating the state of widgets, and calling widget-related actions.
final driver = DuitDriver(
"/layout1",
transportOptions: HttpTransportOptions(
defaultHeaders: {"Content-Type": "application/json"},
baseUrl: "http://localhost:8999",
),
);
DuitViewHost(
driver: driver,
placeholder: const CircularProgressIndicator(),
),
MIT