What problem does it solve?
Adding validation to Flet Python controls requires choosing between field-level Annotated rules, class-level validation_rules, and before_update() checks, while keeping docstrings, tests, and Dart-side behavior consistent. This Skill provides the conventions and decision order to do that correctly.
Core Features & Use Cases
- Validation Decision Order: Guides you to prefer Annotated[..., V.*] field rules, then validation_rules for cross-field invariants, and before_update() only for normalization or non-ruleable checks.
- Docstring Conventions: Standardizes Raises: ValueError entries per logical rule, with canonical wording sourced from the V.* helpers in flet/utils/validation.py.
- Dart Alignment: Ensures Python-side constraints mirror Dart wrapper and Flutter widget assertions so invalid payloads fail before crossing to Dart.
- Use Case: When adding a constrained property like a slider's min/max/value bounds, use this Skill to write the Annotated rules, matching Raises docstrings, and boundary tests.
Quick Start
Ask the AI to add validation to a Flet control property, for example to enforce that a slider's value stays between its min and max using V rules with matching docstrings and tests.