About
A lightweight, extensible framework for building Flutter UIs driven entirely by server-side JSON schemas. Decouple your UI layer from your release cycle — ship layout changes, new screens, and widget compositions directly from your API without pushing a new app version to the store.
Context
Problem
Every UI change in a traditional Flutter app requires a full release cycle — code review, CI/CD, App Store approval, and user adoption. For teams iterating fast or running A/B tests, this is a significant bottleneck.
Solution
sdui_core lets you define widgets as a JSON schema on your server and render them natively in Flutter. Your app becomes a rendering engine. Your server becomes the source of truth for UI.
Features
- JSON-schema driven widget rendering — map any JSON node to a Flutter widget
- Extensible registry — register your own custom widget builders
- Nested layout support — compose complex trees from JSON
- Conditional rendering — show/hide widgets based on server-side flags
- Type-safe builder API — full Dart type safety throughout
- Zero external dependencies — only Flutter SDK required
Tags
Installation
Or add sdui_core: ^0.3.1 to your pubspec.yaml.
Basic Usage
import 'package:sdui_core/sdui_core.dart'; // 1. Create a registry and register widget buildersfinal registry = SduiRegistry() ..register('text', (node, _) => Text( node.props['value'] ?? '', style: TextStyle(fontSize: node.props['size']?.toDouble()), )) ..register('column', (node, render) => Column( children: node.children.map(render).toList(), )) ..register('button', (node, _) => ElevatedButton( onPressed: () {}, child: Text(node.props['label'] ?? 'Tap'), )); // 2. Fetch schema from your server (any JSON source)final schema = SduiNode.fromJson(await fetchFromServer()); // 3. Render it — drops directly into any widget treeWidget build(BuildContext context) => SduiRenderer( registry: registry, node: schema,);Server JSON Schema
{ "type": "column", "children": [ { "type": "text", "props": { "value": "Hello from server!", "size": 24 } }, { "type": "button", "props": { "label": "Tap me" } } ]}