Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.6.1] - 2026-03-09
#### [@rickypid](https://github.com/rickypid)

### Fixed

* Make `_focusListener` and `_blurListener` nullable in `WebWidgetsBinding`.

## [1.6.0] - 2025-06-17
#### [@rickypid](https://github.com/rickypid)

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: example
description: A new Flutter project.
publish_to: 'none'

version: 1.5.1
version: 1.6.1

environment:
sdk: '>=3.4.0 <4.0.0'
Expand Down
12 changes: 8 additions & 4 deletions lib/src/widgets/user_status_detector/web_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import 'platforms_widgets_binding.dart';
PlatformsWidgetsBinding getInstance() => WebWidgetsBinding();

class WebWidgetsBinding extends PlatformsWidgetsBinding {
late JSFunction _focusListener;
late JSFunction _blurListener;
JSFunction? _focusListener;
JSFunction? _blurListener;

@override
void addObserver(WidgetsBindingObserver state) {
Expand All @@ -26,7 +26,11 @@ class WebWidgetsBinding extends PlatformsWidgetsBinding {

@override
void removeObserver(WidgetsBindingObserver state) {
web.window.removeEventListener('focus', _focusListener);
web.window.removeEventListener('blur', _blurListener);
if (_focusListener != null) {
web.window.removeEventListener('focus', _focusListener);
}
if (_blurListener != null) {
web.window.removeEventListener('blur', _blurListener);
}
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: flutter_supabase_chat_core
description: >
Actively maintained, community-driven Supabase BaaS for chat applications
with an optional chat UI.
version: 1.6.0
version: 1.6.1
homepage: https://flutter-supabase-chat-core.insideapp.it
repository: https://github.com/insideapp-srl/flutter_supabase_chat_core

Expand Down