ai_ui_render 0.1.0
ai_ui_render: ^0.1.0 copied to clipboard
AI-driven JSON to Flutter UI rendering framework. Safely generate Flutter UI from AI prompts with guardrailed component catalogs, streaming support, visibility conditions, and rich action handling.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-01-23 #
Added #
-
Core Types
UIElement- Base UI element structure with key, type, props, children, and visibilityUITree- Flat tree structure optimized for LLM generationDynamicValue- Support for literal values or path references to data modelJsonPatch- JSON patch operations for streaming updates
-
Component Catalog System
AiUiCatalog- Registry of allowed components (safety guardrail)CatalogBuilder- Fluent API for building catalogscreateCatalog()- Helper function to create catalog buildersgenerateCatalogPrompt()- Generate AI prompts from catalog
-
Visibility Conditions
- Boolean conditions (
true/false) - Path-based conditions (truthy check on data path)
- Auth-based conditions (
signedIn/signedOut) - Logic expressions (
and,or,not) - Comparison expressions (
eq,neq,gt,gte,lt,lte)
- Boolean conditions (
-
Rendering
JsonRenderer- Main widget for rendering UI trees with Provider integrationStandaloneJsonRenderer- Standalone renderer without Provider dependencyComponentRegistry- Maps component types to widget buildersElementBuilder- Builds widgets from elements recursively
-
State Management (Provider)
DataProvider- Manages data model and auth stateVisibilityProvider- Evaluates visibility conditionsActionProvider- Handles action execution with confirmationsJsonUIProvider- Combined provider widget
-
Streaming Support
UIStreamController- Controller for streaming UI generationUIStreamProvider- InheritedWidget for stream access- JSONL parser for incremental updates
applyPatch()- Apply JSON patches to UI tree
-
Actions System
Action- Rich action definition with params, confirm, callbacksActionConfirm- Confirmation dialog configurationresolveAction()- Resolve dynamic values in actions- Success/error handlers with navigation and data updates
-
Validation
- Built-in validators:
required,email,minLength,maxLength,pattern,min,max,url Validators.compose()- Combine multiple validators- Custom validation function support
- Built-in validators:
Example #
- Complete dashboard example demonstrating all features
- Pre-built components: Card, Text, Button, Row, Column, Icon, Badge, Divider, Spacer