One state value, one source of truth.
Programmatic changes refresh the control without replaying the user callback. This keeps validation and domain updates in one predictable direction.
private readonly State<string> _name = new("");
new TextField(
_name,
label: "Project name",
placeholder: "Enter a name",
onChanged: value => SaveDraft(value));Model validation as owned form state.
Keep validation close to the field or form owner. Submit only after the form has validated its fields; error presentation remains part of the control contract.
Reset owned field values deliberately. Rebuilding a widget tree is not a substitute for deciding what application data should change.
Style controls through a theme, then override with intent.
ThemeData supplies component defaults. A local style can override only the values it needs while retaining the rest of the active theme.
new Theme(
theme,
new Button("Save project", Save, ButtonVariant.Primary));