Skip to content

Commit 0507aeb

Browse files
committed
Merge branch 'flet-0.86' into flet-test
Bring the `flet test` (on-device integration testing) branch up to date with the current flet-0.86 line for a clean cross-platform CI experiment. Conflict resolution: - dart-bridge build template (lib/main.dart, native_runtime*.dart, python.dart, pubspec.yaml) and app.py / __init__.py / python_versions.py: take flet-0.86 — its #6601/#6608 dart-bridge + serious_python 4.x packaging supersedes the earlier prototype that this branch built on. The flet-test feature rides on top (separate tester socket channel, build_base test_mode injection, the integration_test/ entry + flet_integration_test package — all preserved). - flet_backend.dart: keep flet-0.86's bootStatus wiring + this branch's `"test": ... FLET_TEST` page prop. - cli.py: keep both `flet test` and the new `flet clean` registrations. - _typos.toml: union (UDID/udid + certifi). - CHANGELOG.md / breaking-changes index: take flet-0.86 (superset). - website/sidebars.js: accept flet-0.86's deletion (now generated from sidebars.yml).
2 parents 6e52132 + 6e6fab2 commit 0507aeb

289 files changed

Lines changed: 9188 additions & 6233 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/skills/implement-flet-extension/SKILL.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Implement a Flet extension around an external Flutter package using existing `fl
4444

4545
## Flutter-side Rules
4646

47-
- Use `parseEnum()` for enums.
47+
- Use `parseEnum()` for enums — it's exported from `package:flet/flet.dart`. Call it as `parseEnum(MyEnum.values, widget.control.getString("attr"), MyEnum.defaultVal)!`. Do NOT write a custom `_parseXxx()` switch helper.
4848
- For control attributes, prefer `widget.control.getBool()/getDouble()/...` accessors.
4949
- For non-control parsing, use shared `parseSomething()` helpers.
5050
- Do not add one-off private parser utilities when standard helpers exist.
@@ -65,22 +65,33 @@ Without matching defaults, Dart receives `null` and either crashes or silently u
6565

6666
## Integration Checklist
6767

68-
- Add dependency and registration to Flet client app.
69-
- Add extension package to `sdk/python/pyproject.toml`.
70-
- Add extension to `sdk/python/packages/flet/pyproject.toml`.
71-
- Add extension to `sdk/python/examples/apps/flet_build_test/pyproject.toml`.
68+
- Register in the Flet client app — two files:
69+
1. `client/pubspec.yaml`: add `flet_<ext>: path: ../sdk/python/packages/flet-<ext>/src/flutter/flet_<ext>` under `dependencies`.
70+
2. `client/lib/main.dart`: add `import 'package:flet_<ext>/flet_<ext>.dart' as flet_<ext>;` and `flet_<ext>.Extension()` to the `extensions` list.
71+
- Add extension package to `sdk/python/pyproject.toml` in **two places**: the `dependencies` list and `[tool.uv.sources]` as `{ workspace = true }`.
72+
- Add extension to `sdk/python/packages/flet/pyproject.toml` in the `[dependency-groups] extensions` list.
73+
- Add extension to `sdk/python/examples/apps/flet_build_test/pyproject.toml` in **three places**: `[project] dependencies`, `[tool.uv.sources]` as `{ path = "...", editable = true }`, and `[tool.flet.dev_packages]` as a relative path string.
74+
- Add extension to `tools/crocodocs/pyproject.toml` under `[tool.crocodocs.packages]` as `<pkg_name> = "../../sdk/python/packages/<pkg-dir>/src"`. This fixes "Missing API entry" errors in the docs. Note: `api-data.json` is gitignored (generated at build time); only the `pyproject.toml` change needs committing.
7275
- Add extension to `.github/workflows/ci.yml` in both places:
7376
- `build_flet_extensions` -> `PACKAGES` list.
7477
- `py_publish` -> `for pkg in ...` publish loop.
7578
- Add `.gitignore` to Flutter extension project if missing.
79+
- Remove `[tool.uv.sources]` local path overrides from example `pyproject.toml` files before opening a PR (they are development-only conveniences).
7680

7781
## Docs, Examples, Tests
7882

7983
- Add control/service docs under `website/docs/controls/<name>` for controls and `website/docs/services/<name>` for services.
84+
- Always create one doc page per control, even for extensions with many similar controls. Use `index.md` for the overview (install instructions, examples, list of links) and individual `<controlname>.md` files for each control — consistent with `flet-color-pickers` and other extensions.
85+
- Use `<ClassSummary name="pkg.ClassName" />` and `<ClassMembers name="pkg.ClassName" />` JSX from `@site/src/components/crocodocs` to render API docs. Do NOT add `image=`, `imageCaption=`, or `imageWidth=` props to `<ClassSummary>` when no screenshots exist yet.
86+
- In the `## Examples` section, do NOT add `###` subtitles above `<CodeExample>` blocks — titles are injected automatically from the example file itself.
8087
- Add all custom enums/types docs and update `website/sidebars.yml` navigation.
8188
- Use markdown filenames without underscores (`codeeditor.md`, not `code_editor.md`).
82-
- Add examples under `sdk/python/examples` in the appropriate category for control vs service.
83-
- Add integration tests under `packages/flet/integration_tests` in the appropriate category for control vs service.
89+
- Add examples under `sdk/python/examples/extensions/<name>/` for extension controls.
90+
- Use `import flet_<ext> as <short_alias>` in examples (e.g., `import flet_spinkit as spins`). Keep alias short but readable.
91+
- Use `ft.Colors.SURFACE_CONTAINER_HIGHEST` for card/cell backgrounds in showcase examples — it adapts to light and dark system themes automatically.
92+
- Do NOT set an explicit dark theme in examples; let the app use system theme (no `page.theme_mode`).
93+
- Add integration tests under `packages/flet/integration_tests/extensions/<name>/`**not** inside the extension package's own directory (no `tests/` folder in the package itself, matching the pattern of `flet-code-editor`, `flet-color-pickers`, etc.).
94+
- For controls with continuously-running animations, do NOT use `assert_control_screenshot` or `pump_and_settle` — they will timeout waiting for animations to settle. Instead use `await flet_app.tester.pump(duration=ft.Duration(milliseconds=500))` which advances the clock by a fixed amount. This still runs real Flutter rendering and catches crashes, without screenshot comparison.
8495
- Ensure generated screenshots are suitable for docs usage when visual examples are added.
8596

8697
## Upgrade and Compatibility Guardrails

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.41.7"
2+
"flutter": "3.44.3"
33
}

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ jobs:
6464
shell: bash
6565
working-directory: ${{ env.SDK_PYTHON }}
6666
run: |
67-
uv run --no-dev --group test pytest packages/flet/tests
68-
uv run --no-dev --group test pytest packages/flet-cli/tests
67+
uv run --no-dev --group test pytest packages/*/tests
6968
7069
- name: Run docs-coverage
7170
if: matrix.python-version == '3.12'
@@ -673,6 +672,7 @@ jobs:
673672
flet-permission-handler
674673
flet-rive
675674
flet-secure-storage
675+
flet-spinkit
676676
flet-video
677677
flet-webview
678678
)
@@ -837,6 +837,7 @@ jobs:
837837
flet_permission_handler \
838838
flet_rive \
839839
flet_secure_storage \
840+
flet_spinkit \
840841
flet_video \
841842
flet_webview; do
842843
uv publish dist/**/${pkg}-*

0 commit comments

Comments
 (0)