unsubscribe method
Unsubscribe from a specific topic
Example
await realtime.unsubscribe(topic: 'chat.room1');
Implementation
Future<void> unsubscribe({RealtimeTopic? topic}) async {
if (topic != null) {
try {
final subscription = _subscriptions.firstWhere(
(sub) => sub.topic == topic,
);
await subscription.unsubscribe();
} catch (e) {
// Subscription not found, ignore
}
}
}