provider.listen false, revert final
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
erinn 2022-08-26 14:44:13 -07:00
parent cac2064731
commit 74ab39067e
1 changed files with 4 additions and 4 deletions

View File

@ -41,7 +41,7 @@ class MessageView extends StatefulWidget {
} }
class _MessageViewState extends State<MessageView> { class _MessageViewState extends State<MessageView> {
var ctrlrCompose = TextEditingController(); final ctrlrCompose = TextEditingController();
final focusNode = FocusNode(); final focusNode = FocusNode();
int selectedContact = -1; int selectedContact = -1;
ItemPositionsListener scrollListener = ItemPositionsListener.create(); ItemPositionsListener scrollListener = ItemPositionsListener.create();
@ -65,7 +65,7 @@ class _MessageViewState extends State<MessageView> {
showDown = false; showDown = false;
} }
}); });
ctrlrCompose.text = Provider.of<ContactInfoState>(context).messageDraft ?? ""; ctrlrCompose.text = Provider.of<ContactInfoState>(context, listen: false).messageDraft ?? "";
super.initState(); super.initState();
} }
@ -349,7 +349,7 @@ class _MessageViewState extends State<MessageView> {
); );
} }
Provider.of<ContactInfoState>(context).messageDraft = null; Provider.of<ContactInfoState>(context, listen: false).messageDraft = null;
ctrlrCompose.clear(); ctrlrCompose.clear();
focusNode.requestFocus(); focusNode.requestFocus();
@ -547,7 +547,7 @@ class _MessageViewState extends State<MessageView> {
enabled: true, // always allow editing... enabled: true, // always allow editing...
onChanged: (String x) { onChanged: (String x) {
Provider.of<ContactInfoState>(context).messageDraft = x; Provider.of<ContactInfoState>(context, listen: false).messageDraft = x;
setState(() { setState(() {
// we need to force a rerender here to update the max length count // we need to force a rerender here to update the max length count
}); });