import 'package:flutter/foundation.dart';

class NetworkStatusService {
  final connectionUpdateStatus = ValueNotifier<bool>(false);
  final directMessageUpdateStatus = ValueNotifier<bool>(false);
  final notificationsUpdateStatus = ValueNotifier<bool>(false);
  final interactionsLoadingStatus = ValueNotifier<bool>(false);
  final timelineLoadingStatus = ValueNotifier<bool>(false);
  final imageGalleryLoadingStatus = ValueNotifier<bool>(false);
  final searchLoadingStatus = ValueNotifier<bool>(false);

  void startConnectionUpdateStatus() {
    connectionUpdateStatus.value = true;
  }

  void finishConnectionUpdateStatus() {
    connectionUpdateStatus.value = false;
  }

  void startDirectMessageUpdateStatus() {
    directMessageUpdateStatus.value = true;
  }

  void finishDirectMessageUpdateStatus() {
    directMessageUpdateStatus.value = false;
  }

  void startNotificationUpdate() {
    notificationsUpdateStatus.value = true;
  }

  void finishNotificationUpdate() {
    notificationsUpdateStatus.value = false;
  }

  void startTimelineLoading() {
    timelineLoadingStatus.value = true;
  }

  void finishTimelineLoading() {
    timelineLoadingStatus.value = false;
  }

  void startGalleryLoading() {
    imageGalleryLoadingStatus.value = true;
  }

  void finishGalleryLoading() {
    imageGalleryLoadingStatus.value = false;
  }

  void startInteractionsLoading() {
    interactionsLoadingStatus.value = true;
  }

  void finishInteractionsLoading() {
    interactionsLoadingStatus.value = false;
  }

  void startSearchLoading() {
    searchLoadingStatus.value = true;
  }

  void finishSearchLoaing() {
    searchLoadingStatus.value = false;
  }
}
