Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After "when" how to update TextEditingContoller #2

Open
dyardy opened this issue Dec 4, 2022 · 0 comments
Open

After "when" how to update TextEditingContoller #2

dyardy opened this issue Dec 4, 2022 · 0 comments

Comments

@dyardy
Copy link

dyardy commented Dec 4, 2022

Thank you for your contributions.

I do have a question that I am searching for an answer to. I was searching for a solution within your public repos' and could not see one.

Within my widget, as shown below, how do I update the initial value of the TextFormField after gettingPost from my ref.watch?

 return ref.watch(getLocalPostProvider(widget.id!)).when( 
      data: (item) => Scaffold(
      ... 
            TextFormField(
                  controller: descriptionController, //<<<<
                  maxLines: 10,
                  minLines: 5,
                  textInputAction: TextInputAction.done,
                  textCapitalization: TextCapitalization.sentences,
                  decoration: const InputDecoration(
                    labelText: "Description",
                  ),
                  onChanged: (v) =>{}
                ),
      ...
      )

I am reviewing the edit_profile_screen.dart page when a id is passed in then you are performing ref.watch(getUserDataProvider(widget.uid)).when ... I want to do this but then set the initial value of the textfield controllers within the when syntax. It seems that this is not possible?

Your assistance is very much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant