Skip to content

Commit

Permalink
fix: 🐛 correct usage of provide after unmount
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbadstuebner committed Jun 17, 2024
1 parent 232214c commit 9cbfcc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/src/extensions/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ extension ChatViewStateTitleExtension on String? {

/// Extension on State for accessing inherited widget.
extension StatefulWidgetExtension on State {
ChatViewInheritedWidget? get provide => ChatViewInheritedWidget.of(context);
ChatViewInheritedWidget? get provide =>
mounted ? ChatViewInheritedWidget.of(context) : null;

ReplySuggestionsConfig? get suggestionsConfig =>
SuggestionsConfigIW.of(context)?.suggestionsConfig;
Expand Down

0 comments on commit 9cbfcc8

Please sign in to comment.