You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,8 +122,8 @@ Audio tracks are rendered automatically as long as you are subscribed to them.
122
122
123
123
LiveKit client makes it simple to build declarative UI that reacts to state changes. It notifies changes in two ways
124
124
125
-
* `ChangeNotifier` - generic notification of changes
126
-
* `RoomDelegate` and `ParticipantDelegate` - notification of specific events.
125
+
* `ChangeNotifier` - generic notification of changes. This is useful when you are building reactive UI and only care about changes that may impact rendering.
126
+
* `EventsListener<Event>` - listener pattern to listen to specific events (see [events.dart](https://github.com/livekit/client-sdk-flutter/blob/main/lib/src/events.dart)).
127
127
128
128
This example will show you how to use both to react to room events.
129
129
@@ -139,17 +139,30 @@ class RoomWidget extends StatefulWidget {
139
139
}
140
140
}
141
141
142
-
class _RoomState extends State<RoomWidget> with RoomDelegate {
142
+
class _RoomState extends State<RoomWidget> {
143
+
late final EventsListener<RoomEvent> _listener = widget.room.createListener();
0 commit comments