Files
tm_app/lib/data/services/notification_state_service.dart
T

18 lines
490 B
Dart

import 'package:flutter/foundation.dart';
/// Service to manage notification state across the app
class NotificationStateService extends ChangeNotifier {
bool _hasUnreadNotification = false;
bool get hasUnreadNotification => _hasUnreadNotification;
void setHasUnreadNotification(bool value) {
if (_hasUnreadNotification != value) {
_hasUnreadNotification = value;
notifyListeners();
}
}
void clearUnreadNotification() => setHasUnreadNotification(false);
}