File tree 3 files changed +9
-4
lines changed
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 44
44
to hide user name in chat.
45
45
* ** Fix** : [ 182] ( https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/182 ) Fix
46
46
send message not working when user start texting after newLine.
47
+ * ** Fix** : [ 191] ( https://github.com/SimformSolutionsPvtLtd/flutter_chatview/issues/191 ) Fix
48
+ error when using ` BuildContext ` or ` State ` extensions when not mounted.
47
49
48
50
## [ 1.3.1]
49
51
Original file line number Diff line number Diff line change 6
6
4 . Make sure your code lints.
7
7
5 . Push your work back up to your fork.
8
8
6 . Create the pull request!
9
+ 7 . Include the PR in the CHANGELOG.md
Original file line number Diff line number Diff line change @@ -129,16 +129,18 @@ extension ChatViewStateTitleExtension on String? {
129
129
130
130
/// Extension on State for accessing inherited widget.
131
131
extension StatefulWidgetExtension on State {
132
- ChatViewInheritedWidget ? get provide => ChatViewInheritedWidget .of (context);
132
+ ChatViewInheritedWidget ? get provide =>
133
+ mounted ? ChatViewInheritedWidget .of (context) : null ;
133
134
134
135
ReplySuggestionsConfig ? get suggestionsConfig =>
135
- SuggestionsConfigIW .of (context)? .suggestionsConfig;
136
+ mounted ? SuggestionsConfigIW .of (context)? .suggestionsConfig : null ;
136
137
}
137
138
138
139
/// Extension on State for accessing inherited widget.
139
140
extension BuildContextExtension on BuildContext {
140
- ChatViewInheritedWidget ? get provide => ChatViewInheritedWidget .of (this );
141
+ ChatViewInheritedWidget ? get provide =>
142
+ mounted ? ChatViewInheritedWidget .of (this ) : null ;
141
143
142
144
ReplySuggestionsConfig ? get suggestionsConfig =>
143
- SuggestionsConfigIW .of (this )? .suggestionsConfig;
145
+ mounted ? SuggestionsConfigIW .of (this )? .suggestionsConfig : null ;
144
146
}
You can’t perform that action at this time.
0 commit comments