add notification, fix appbar,fix style subscription
This commit is contained in:
@@ -33,4 +33,22 @@ class NotificationRepositoryImpl implements NotificationRepository {
|
||||
void closeStream() {
|
||||
// соединение закрывается автоматически при отписке от stream
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<ClientNotification>> getNotifications() async {
|
||||
try {
|
||||
final List<Map<String, dynamic>> data = await _apiService.getNotifications();
|
||||
final notifications = data.map((json) {
|
||||
final dto = ClientNotificationDto.fromJson(json);
|
||||
return dto.toEntity();
|
||||
}).toList();
|
||||
|
||||
// dev.log('NotificationRepository: Загружено ${notifications.length} уведомлений');
|
||||
|
||||
return notifications;
|
||||
} catch (e, stackTrace) {
|
||||
// dev.log('NotificationRepository: Ошибка: $e', stackTrace: stackTrace);
|
||||
throw Exception('Не удалось загрузить уведомления: $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user