File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
templates/flutter/lib/src Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -7,5 +7,40 @@ import 'client.dart';
77
88abstract class Realtime extends Service {
99 factory Realtime(Client client) => createRealtime(client);
10+
11+ /// Channels to subscribe - pass a list of channels to subscribe
12+ ///
13+ /// Possible channels are:
14+ /// - account
15+ /// - collections
16+ /// - collections.[ID]
17+ /// - collections.[ID].documents
18+ /// - documents
19+ /// - documents.[ID]
20+ /// - files
21+ /// - files.[ID]
22+ /// - executions
23+ /// - executions.[ID]
24+ /// - functions.[ID]
25+ /// - teams
26+ /// - teams.[ID]
27+ /// - memberships
28+ /// - memberships.[ID]
29+ ///
30+ /// Returns a `RealtimeSubscription` object, which can be used to listen to events on the channels
31+ /// and to close the subscription to stop listening.
32+ ///
33+ /// The sample shows how you could use realtime to listen to changes in a collections.
34+ ///
35+ /// ```dart
36+ /// final realtime = Realtime(client);
37+ /// final subscription = realtime.subscribe(['collections']);
38+ /// subscription.stream.listen((event) {
39+ /// print(event);
40+ /// });
41+ ///
42+ /// subscription.close();
43+ /// ```
44+ ///
1045 RealtimeSubscription subscribe(List<String > channels);
1146}
You can’t perform that action at this time.
0 commit comments