flutter_sdui_kit 0.2.0
flutter_sdui_kit: ^0.2.0 copied to clipboard
A server-driven UI framework for Flutter.
Changelog #
0.2.0 #
New Components #
expanded— JSON-side Expanded/Flexible wrapper withflexandfitpropscenter— Center wrappersafe_area— SafeArea wrapper with per-edge controlaspect_ratio— AspectRatio wrapperconstrained_box— ConstrainedBox with min/max width/height
Layout Safety #
- Column/Row now use
mainAxisSize: MainAxisSize.min— no more unbounded axis crashes - Column/Row support
scrollprop to auto-wrap in SingleChildScrollView - Per-child
flex/flex_fitprops on any child in a Column/Row (replaces blind Expanded wrapping) - List builder uses
ListView.builderwithshrinkWrap: true+NeverScrollableScrollPhysics - Horizontal lists accept
height/widthprops for cross-axis sizing LayoutErrorBoundary,SduiConstraints,ConstraintGuardlayout helpers
Error Handling #
SduiError— structured error with type, message, nodeType, exception, stackTraceSduiErrorTypeenum — parse, render, unknownComponent, expressiononErrorcallback on SduiWidget — receives every error during renderingerrorWidgetBuilderon SduiWidget — replaces broken nodes with custom widgetsfallbackwidget (renamed fromerrorWidget) — shown when JSON is null/empty/invalid- Renderer error boundary: broken nodes become
SizedBox.shrink(), siblings keep rendering - Expression evaluator wrapped in try-catch — bad
visible_ifhides node instead of crashing
API Changes #
- Breaking:
SduiWidgetno longer acceptsscreen:parameter — usejson:only - Breaking:
errorWidgetrenamed tofallback SduiWidget.jsonis nowrequired(nullableString?)- Exported
sdui_error.dartandlayout_helpers.dartfrom barrel file
Documentation #
- Complete README rewrite with Quick Start, JSON Protocol, all 23 components, state management examples (setState, Riverpod, Bloc, GetX), layout safety guide, architecture diagram, API reference
- Comprehensive doc comments on all public builders
Tests #
- 158 total tests (45 unit + 79 widget + 34 edge case)
- Widget tests for all 23 component types
- Edge case tests: infinite layouts, empty data, error resilience, state management patterns
0.1.1 #
Initial public release.
Core #
SduiNode— recursive JSON-to-model tree parserSduiScreen— top-level screen model with theme + metadataSduiAction— declarative action model (navigate, api_call, etc.)SduiTheme— server-side colour overridesSduiRenderer— walks the node tree and builds a Flutter widget treeComponentRegistry— extensible map oftype→ builder functionsActionHandler— dispatcher for user-interaction actionsSduiWidget— drop-in StatelessWidget that renders from JSON or model
Data Binding #
TemplateResolver—{{user.name}}placeholder resolution in stringsExpressionEvaluator— condition engine forvisible_ifexpressionsSduiDataProvider— InheritedWidget to flow data context down the tree
Built-in Components #
- Layout:
column,row,padding,sizedbox,container,scroll - Content:
text,image,button,icon - Composite:
card,list,divider - Form:
text_input,checkbox,switch,dropdown - Interaction:
gesture
Utilities #
StyleParser— hex→Color, EdgeInsets, TextStyle, alignment resolvers