File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -129,16 +129,18 @@ extension ChatViewStateTitleExtension on String? {
129129
130130/// Extension on State for accessing inherited widget.
131131extension StatefulWidgetExtension on State {
132- ChatViewInheritedWidget ? get provide => ChatViewInheritedWidget .of (context);
132+ ChatViewInheritedWidget ? get provide =>
133+ mounted ? ChatViewInheritedWidget .of (context) : null ;
133134
134135 ReplySuggestionsConfig ? get suggestionsConfig =>
135- SuggestionsConfigIW .of (context)? .suggestionsConfig;
136+ mounted ? SuggestionsConfigIW .of (context)? .suggestionsConfig : null ;
136137}
137138
138139/// Extension on State for accessing inherited widget.
139140extension BuildContextExtension on BuildContext {
140- ChatViewInheritedWidget ? get provide => ChatViewInheritedWidget .of (this );
141+ ChatViewInheritedWidget ? get provide =>
142+ mounted ? ChatViewInheritedWidget .of (this ) : null ;
141143
142144 ReplySuggestionsConfig ? get suggestionsConfig =>
143- SuggestionsConfigIW .of (this )? .suggestionsConfig;
145+ mounted ? SuggestionsConfigIW .of (this )? .suggestionsConfig : null ;
144146}
You can’t perform that action at this time.
0 commit comments