Skip to content

Add onReset callback to FormField<T> #167057

Closed
@foxmind1

Description

@foxmind1

Use case

While it’s possible to extend FormField and override FormFieldState.reset(), there’s no built-in way to respond to a reset when using FormField directly as a widget. This becomes a problem when creating custom form widgets that need to reset internal state. Unlike onSaved, there’s no onReset callback to easily handle this lifecycle event without subclassing.

Proposal

i’d like to add an optional onReset callback to FormField, similar to onSaved, which gets triggered when FormFieldState.reset() is called.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions