post merge commit
This commit is contained in:
@@ -26,16 +26,36 @@ class RecentConverstationsPage extends StatefulWidget {
|
||||
|
||||
class _RecentConverstationsPageState extends State<RecentConverstationsPage> {
|
||||
late MessagingProviders _auth;
|
||||
List<Conversations> streamData = [];
|
||||
|
||||
final myController = StreamController<List<Conversations>>.broadcast();
|
||||
Stream<List<Conversations>> get messageStream => myController.stream;
|
||||
|
||||
void messager() {
|
||||
MessagingProviders.instance.getUserConversation(_auth.user!.$id);
|
||||
// To listen to the conversations stream
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
loadStream();
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
myController.close();
|
||||
loadStream() async {
|
||||
streamData =
|
||||
await MessagingProviders.instance.getUserConversations(_auth.user!.$id);
|
||||
}
|
||||
|
||||
subscribe() {
|
||||
MessagingProviders.instance.subscription!.stream.listen((data) {
|
||||
final event = data.events.first;
|
||||
if (event.endsWith('.create')) {
|
||||
streamData.add(data.payload['']);
|
||||
} else if (event.endsWith('.update')) {}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
MessagingProviders.instance.subscription!.stream.listen((data) {
|
||||
final event = data.events.first;
|
||||
;
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user