Skip to content

Commit 9cbfcc8

Browse files
fix: 🐛 correct usage of provide after unmount
1 parent 232214c commit 9cbfcc8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/src/extensions/extensions.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ extension ChatViewStateTitleExtension on String? {
129129

130130
/// Extension on State for accessing inherited widget.
131131
extension 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 =>
135136
SuggestionsConfigIW.of(context)?.suggestionsConfig;

0 commit comments

Comments
 (0)