getUnreadConversationsCountStream method

  1. @override
Stream<int> getUnreadConversationsCountStream()
override

Implementation

@override
Stream<int> getUnreadConversationsCountStream() {
  const MethodChannel("carrotquest_sdk").setMethodCallHandler((call) async {
    if (call.method == "unreadConversationsCount") {
      try {
        int count = int.parse(call.arguments.toString());
        _unreadConversationsCountStreamController.add(count);
      } catch (e) {
        _unreadConversationsCountStreamController.addError(e);
      }
    }
  });
  return _unreadConversationsCountStreamController.stream.asBroadcastStream();
}