Examples are Flutter projects offered as templates on the prompt page. They live as real files in the repository under examples/ and are served to the frontend as ZIP files.
examples/
├── examples.json # Manifest: list of all examples
└── simple_counter/ # Directory name = id from the manifest
├── pubspec.yaml # Must be directly in the example root
└── lib/
├── main.dart
└── counter.dart
The manifest (examples.json) defines id and title for each example:
[ { "id": "simple_counter", "title": "Counter Template" } ]
The id must exactly match the directory name under examples/.
The script tool/bundle_examples.dart zips each example and copies the ZIPs together with the manifest to packages/frontend/web/examples/. From there they are served by the web server as static assets.
dart run tool/bundle_examples.dart
The generated files under web/examples/ are checked in.
On startup the frontend fetches examples/examples.json and displays the templates on the prompt page. When a template is selected it fetches the corresponding ZIP (examples/<id>.zip), extracts it, and writes the files into the workspace.
examples/<id>/ with a pubspec.yaml and lib/examples/examples.jsondart run tool/bundle_examples.dartA minimal Flutter counter app. Demonstrates basic StatefulWidget usage with setState.