Skip to content

[cupertino_ui] Read CupertinoTextFormFieldRow value from its controller - #12596

Draft
kaluli123123 wants to merge 1 commit into
flutter:mainfrom
kaluli123123:port-191658-cupertino-textformfieldrow-value
Draft

kaluli123123 wants to merge 1 commit into
flutter:mainfrom
kaluli123123:port-191658-cupertino-textformfieldrow-value

Conversation

@kaluli123123

@kaluli123123 kaluli123123 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

_CupertinoTextFormFieldRowState now overrides FormFieldState.value to
read _effectiveController.text directly instead of relying on the cached
value FormFieldState tracks internally. This guarantees validators (and
FormField.onSaved) see the current text even when they run before this
state has been notified of a controller change, for example when
FormState.validate() is called from a controller listener that was
registered before this field's own listener.

Depends on the FormFieldState.isValid/validate() fix in flutter/flutter#191708, which reads through the value getter instead of the private cached field. That framework PR is still open and unmerged; this package draft remains blocked on its integration into the SDK used by CI.

Ported from flutter/flutter#191658, which is blocked by the Cupertino code freeze.

Fixes flutter/flutter#40494

_CupertinoTextFormFieldRowState now overrides FormFieldState.value to
read _effectiveController.text directly instead of relying on the cached
value FormFieldState tracks internally. This guarantees validators (and
FormField.onSaved) see the current text even when they run before this
state has been notified of a controller change, for example when
FormState.validate() is called from a controller listener that was
registered before this field's own listener.

Depends on the FormFieldState.isValid/validate() fix in flutter/flutter,
which reads through the value getter instead of the private cached field.

Ported from flutter/flutter#191658, which is blocked by the Cupertino code freeze.

Fixes flutter/flutter#40494
@github-actions github-actions Bot added p: cupertino_ui triage-design Should be looked at in design triage labels Aug 25, 2026
@kaluli123123 kaluli123123 changed the title Read CupertinoTextFormFieldRow value from its controller [cupertino_ui] Read CupertinoTextFormFieldRow value from its controller Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p: cupertino_ui triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FormField validators are invoked with incorrect/old values

1 participant