circle_app/circle_app/lib/util/eventBus.dart

65 lines
1.1 KiB
Dart
Raw Normal View History

2023-07-18 16:05:58 +08:00
import 'dart:async';
import 'package:event_bus/event_bus.dart';
2023-08-05 10:42:53 +08:00
import 'package:tencent_cloud_chat_uikit/tencent_cloud_chat_uikit.dart';
2023-07-18 16:05:58 +08:00
class EventBusManager {
2023-08-05 10:42:53 +08:00
static EventBus? _eventBus;
2023-07-18 16:05:58 +08:00
static EventBus get eventBus {
if (_eventBus == null) {
_eventBus = EventBus();
}
return _eventBus!;
}
static void fire(dynamic event) {
eventBus.fire(event);
}
static Stream<T> on<T>() {
return eventBus.on<T>();
}
static void cancelSubscription(StreamSubscription subscription) {
subscription.cancel();
}
}
2023-08-05 10:42:53 +08:00
class CommentVipEvent {
2023-07-18 16:05:58 +08:00
int vip = 0;
2023-08-05 10:42:53 +08:00
2023-07-18 16:05:58 +08:00
CommentVipEvent(this.vip);
}
2023-08-05 10:42:53 +08:00
class SendCoustomMessage {
V2TimValueCallback<V2TimMsgCreateInfoResult>? createCustomMessageRes = null;
2023-08-07 15:49:10 +08:00
SendCoustomMessage(this.createCustomMessageRes);
}
class CommentBlackEvent {
String userId = "";
bool isBlack = false;
CommentBlackEvent( {required this.userId,required this.isBlack });
}
class CommentBlackMoreEvent {
}
class CallRefreshCircle {
String circleId = "";
CallRefreshCircle(String id);
}
class ScrollToTop {
}
class RefreshUnread {
2023-08-07 15:49:10 +08:00
}