socket fixed

This commit is contained in:
Username1548
2025-01-19 15:10:56 +07:00
parent ab7004f9fd
commit 7eaf0bc1bb
29 changed files with 489 additions and 1006 deletions

View File

@@ -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++;