forked from eatvio/eatvio_app
socket fixed
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
import 'package:eatvio_app/core/initialization_cubit/ws_manager.dart';
|
||||
import 'package:eatvio_app/features/bottom_navigation_bar/presentation/bloc/notifications_cubit/notifications_state.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class NotificationsCubit extends Cubit<NotificationsState> {
|
||||
int _notificationsCount = 0;
|
||||
List<String> notifications = [];
|
||||
|
||||
NotificationsCubit() : super(const NotificationsState.empty());
|
||||
final WsManager wsManager;
|
||||
NotificationsCubit({required this.wsManager}) : super(const NotificationsState.empty()) {
|
||||
wsManager.newNotificationsStream?.listen((event) {
|
||||
incrementCounter(event.data);
|
||||
});
|
||||
}
|
||||
|
||||
incrementCounter(String data) {
|
||||
_notificationsCount++;
|
||||
|
||||
Reference in New Issue
Block a user