Skip to content

exposing FormState _fields value #110760

Description

@casvanluijtelaar

Use case

the form widget can be a powerful tool as it caches and can interact with all its child FormField without having to manually track them through keys. this is useful for a couple build in features like submitting & saving. but blocks the user from creating it's own implementations like for example #107530

Proposal

make the FormState _fields value into a public field so we can use it to extend its functionality

/// State associated with a [Form] widget.
///
/// A [FormState] object can be used to [save], [reset], and [validate] every
/// [FormField] that is a descendant of the associated [Form].
///
/// Typically obtained via [Form.of].
class FormState extends State<Form> {

  final Set<FormFieldState<dynamic>> fields = <FormFieldState<dynamic>>{};
  
   ...

}

this issue would allow us to implement our own extensions that would, for example, make #107528 doable by the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: duplicateIssue is closed as a duplicate of an existing issueteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions