From 21ef8bf68e462999c3e4ae07cd7e1ed125a7d3e2 Mon Sep 17 00:00:00 2001 From: cogwheel0 <172976095+cogwheel0@users.noreply.github.com> Date: Wed, 1 Oct 2025 18:52:53 +0530 Subject: [PATCH] refactor: update ConversationDeltaStream for stream compatibility - Changed the `stream()` method to a public getter `stream` in the `ConversationDeltaStream` class for compatibility with StreamProvider. - Added documentation to clarify the necessity of this change, noting the exception to the Riverpod 3 guideline against public getters on Notifiers. - Updated the `conversationDeltaEventsProvider` to utilize the new getter, enhancing the stream delegation pattern. --- lib/core/providers/app_providers.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/core/providers/app_providers.dart b/lib/core/providers/app_providers.dart index 955994c..6c687fe 100644 --- a/lib/core/providers/app_providers.dart +++ b/lib/core/providers/app_providers.dart @@ -464,8 +464,11 @@ class ConversationDeltaStream extends _$ConversationDeltaStream { } /// Provides direct access to the underlying stream. - /// Exposed as a method to avoid property-based lint violations. - Stream stream() => + /// Note: This getter is necessary for compatibility with StreamProvider. + /// While Riverpod 3 discourages public getters on Notifiers, this is a + /// pragmatic exception for stream delegation patterns. + // ignore: avoid_public_notifier_properties + Stream get stream => _controller?.stream ?? const Stream.empty(); } @@ -477,7 +480,7 @@ final conversationDeltaEventsProvider = final notifier = ref.watch( conversationDeltaStreamProvider(request).notifier, ); - return notifier.stream(); + return notifier.stream; }); // Attachment upload queue provider