Skip to content

Proper Riverpod Provider for Wrapping TextEditingController #2680

Answered by rrousselGit
gawasa29 asked this question in Q&A
Discussion options

You must be logged in to vote

Riverpod doesn't recommend using providers to store TextControllers. They belong to the local widget state. So either use a StatefulWidget or flutter_hooks

Using a provider means that if two screens use the same provider, they will share their controller state. This is undesired.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@harunoh1
Comment options

@harunoh1
Comment options

@hamza-imran75
Comment options

@harunoh1
Comment options

@harunoh1
Comment options

Answer selected by gawasa29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants