Skip to content

initialValue of TextFormField is not set if it is fetched async #17282

@benjaminhorner

Description

@benjaminhorner

Steps to Reproduce

  1. Create a TextFormField with initialValue = _var
  2. In the initState() of the StatefulWidget it is in set the _var async and call setState()
  3. The TextFormField is not filled with the _var

Note: it works fine with when the _var is set sync instead of async.

Workaround for now

Use a TextEditingController() and set it's text attribute in the async callback rather than setting the initialValue attached to a key in the state.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions