feat(stac_gen_ui): add AI-powered UI generation package using Claude API#471
Closed
divyanshub024 wants to merge 3 commits intodevfrom
Closed
feat(stac_gen_ui): add AI-powered UI generation package using Claude API#471divyanshub024 wants to merge 3 commits intodevfrom
divyanshub024 wants to merge 3 commits intodevfrom
Conversation
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
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
https://claude.ai/code/session_01X1jPBd2TWLaNRH5vZxeR3U