Skip to content

feat(stac_gen_ui): add AI-powered UI generation package using Claude API#471

Closed
divyanshub024 wants to merge 3 commits intodevfrom
claude/stac-gen-ui-package-3LWV0
Closed

feat(stac_gen_ui): add AI-powered UI generation package using Claude API#471
divyanshub024 wants to merge 3 commits intodevfrom
claude/stac-gen-ui-package-3LWV0

Conversation

@divyanshub024
Copy link
Member

Create a new stac_gen_ui package that generates Flutter UI from natural
language prompts at runtime using Claude API. The package follows existing
stac patterns (StacParser, StacWidget) and uses Claude's tool_use feature
for reliable JSON output.

Key components:

  • StacGenUiConfig: Static configuration for API key and model settings
  • StacGenUiModel: StacWidget subclass with prompt, loader, and error widgets
  • StacGenUiParser: Registers as type "genUi" for use in JSON specs
  • StacGenUiView: StatefulWidget with FutureBuilder for async rendering
  • ClaudeApiService: HTTP client using tool_use for guaranteed JSON output
  • StacSchemaProvider: Minimal system prompt with widget catalog (~2000 tokens)

https://claude.ai/code/session_01X1jPBd2TWLaNRH5vZxeR3U

claude added 3 commits March 16, 2026 11:46
Create a new stac_gen_ui package that generates Flutter UI from natural
language prompts at runtime using Claude API. The package follows existing
stac patterns (StacParser, StacWidget) and uses Claude's tool_use feature
for reliable JSON output.

Key components:
- StacGenUiConfig: Static configuration for API key and model settings
- StacGenUiModel: StacWidget subclass with prompt, loader, and error widgets
- StacGenUiParser: Registers as type "genUi" for use in JSON specs
- StacGenUiView: StatefulWidget with FutureBuilder for async rendering
- ClaudeApiService: HTTP client using tool_use for guaranteed JSON output
- StacSchemaProvider: Minimal system prompt with widget catalog (~2000 tokens)

https://claude.ai/code/session_01X1jPBd2TWLaNRH5vZxeR3U
…nfig.initialize call

StacGenUiConfig.initialize now calls Stac.initialize internally,
auto-registering StacGenUiParser. Users no longer need to call
Stac.initialize separately — one call does everything.

All standard Stac options (parsers, actionParsers, dio, cacheConfig,
etc.) can be passed through StacGenUiConfig.initialize.

https://claude.ai/code/session_01X1jPBd2TWLaNRH5vZxeR3U
Add StacCustomWidgetSchema to let users describe their custom widgets
(type, description, JSON example) so the AI can include them in
generated UI. Custom schemas are passed via customWidgets parameter
in StacGenUiConfig.initialize and automatically injected into the
Claude system prompt.

https://claude.ai/code/session_01X1jPBd2TWLaNRH5vZxeR3U
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants