Skip to content

Documentation of useTextEditingController with useEffect needs to be updated #325

@AhmedLSayed9

Description

@AhmedLSayed9

Hello,

The doc of useTextEditingController suggests using useEffect to update the TextEditingController.text whenever a provided ValueListenable changes.

But, When the provided ValueListenable updates the TextEditingController.text for the second time it'll throw an exception:
setState() or markNeedsBuild() called during build

Suggestion:
Delaying the update by a frame using Future.microtask inside useEffect fixes the issue.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions