provider.listen false, revert final
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
cac2064731
commit
74ab39067e
|
@ -41,7 +41,7 @@ class MessageView extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MessageViewState extends State<MessageView> {
|
||||
var ctrlrCompose = TextEditingController();
|
||||
final ctrlrCompose = TextEditingController();
|
||||
final focusNode = FocusNode();
|
||||
int selectedContact = -1;
|
||||
ItemPositionsListener scrollListener = ItemPositionsListener.create();
|
||||
|
@ -65,7 +65,7 @@ class _MessageViewState extends State<MessageView> {
|
|||
showDown = false;
|
||||
}
|
||||
});
|
||||
ctrlrCompose.text = Provider.of<ContactInfoState>(context).messageDraft ?? "";
|
||||
ctrlrCompose.text = Provider.of<ContactInfoState>(context, listen: false).messageDraft ?? "";
|
||||
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();
|
||||
focusNode.requestFocus();
|
||||
|
||||
|
@ -547,7 +547,7 @@ class _MessageViewState extends State<MessageView> {
|
|||
enabled: true, // always allow editing...
|
||||
|
||||
onChanged: (String x) {
|
||||
Provider.of<ContactInfoState>(context).messageDraft = x;
|
||||
Provider.of<ContactInfoState>(context, listen: false).messageDraft = x;
|
||||
setState(() {
|
||||
// we need to force a rerender here to update the max length count
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue