How it works
From the editor to a phone in four steps
The portal never runs code on the device. It publishes JSON; Stac renders it.
01
Draft
The editor stores one draft per screen. Design view and Code view both edit it, and it autosaves.
02
Publish
The server converts the draft to Stac JSON, validates it, and saves it as a new immutable version. That version becomes the live one.
03
Serve
GET /api/v1/screens/<name> checks the project key and returns the live version as bare Stac JSON. The CDN caches it for 30 seconds.
04
Render
Your app calls Stac.fromNetwork with that URL. Stac turns the JSON into Flutter widgets on the device.
What your app receives
A bare Stac widget object with a type field at the root. Errors use non-2xx status codes, so Stac shows your error widget instead of rendering an error body.
{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Summer sale"
}
},
"body": {
"type": "padding",
"padding": {
"left": 16,
"top": 16,
"right": 16,
"bottom": 16
},
"child": {
"type": "column",
"crossAxisAlignment": "start",
"children": [
{
"type": "text",
"data": "20% off everything until Sunday."
},
{
"type": "elevatedButton",
"child": {
"type": "text",
"data": "Shop now"
},
"onPressed": {
"actionType": "none"
}
}
]
}
}
}What stays in your app
- Navigation between your own Flutter routes
- Authentication and user data
- Business logic, state and offline storage
- Custom widgets, registered as Stac parsers