Introduction
XWidget Builder is a command-line tool and code generator for XWidget projects. It generates the inflaters, controllers, icons, and XML schema files that XWidget needs to render your UI from XML fragments at runtime.
What It Does
XWidget Builder handles two concerns:
Code Generation — Reads your specification files and generates Dart code that bridges XML markup to Flutter widgets. This includes inflater classes (which construct widgets from XML attributes), icon registrations, controller factories, and an XSD schema for IDE code completion.
Cloud & Analytics CLI — Provides commands for deploying UI bundles to XWidget Cloud and querying analytics data from your deployed apps.
Installation
Add xwidget_builder as a dev dependency:
Or let the init command handle it automatically — see
Project Initialization.
Key Principle
Important
Only specify widgets that you actually use in your UI. Code is generated for every component you specify, which neutralizes Flutter's tree-shaking. Unused widgets and helper classes in your specs will bloat your app size.
CLI Commands
XWidget Builder provides four top-level commands:
| Command | Description |
|---|---|
xc init |
Bootstrap a Flutter project for XWidget development |
xc generate |
Generate inflaters, icons, controllers, and schema |
xc cloud |
Deploy and manage projects on XWidget Cloud |
xc analytics |
Query analytics data from deployed apps |
See CLI Setup to install the xc command.