diff --git a/CHANGELOG.md b/CHANGELOG.md index ef7a8b4..71df2ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index f13f00d..8486ff1 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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' diff --git a/lib/src/widgets/user_status_detector/web_platform.dart b/lib/src/widgets/user_status_detector/web_platform.dart index 4450203..caff831 100644 --- a/lib/src/widgets/user_status_detector/web_platform.dart +++ b/lib/src/widgets/user_status_detector/web_platform.dart @@ -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) { @@ -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); + } } } diff --git a/pubspec.yaml b/pubspec.yaml index 7e85840..002b874 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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