Closed HadiHassan22 closed 6 hours ago
No you are mistaken, or at least I'm not able to reproduce it (Dart 3.5.2).
RecordService.subscribe
expects the callback to be of RecordSubscriptionFunc
that correctly accept RecordSubscriptionEvent
argument.
Feel free to provide a more complete code that could trigger the above linter error and I'll try to investigate it but it works correctly for me (you can also test the example in the example/example.dart
).
Maybe you are confusing the collection specific subscribe method with the generic pb.realtime.subscribe
?
The documentation implies the subscribe function takes a listener that listens to events of type RecordSubscriptionEvent. But in reality the subscribe function takes a listener of type SseMessage.
So even the example in the pub documentation:
leads to a linter type error: The getter 'action' isn't defined for the type 'SseMessage'.
I believe either the documentation should be updated to make use of SseMessage type or the function should take a listener of RecordSubscriptionEvent events.