import 'dart:async';
import 'package:traderscircuit/Utils/api_urls.dart';
import 'package:traderscircuit/Utils/base_manager.dart';
import 'package:traderscircuit/data/network/network_api_services.dart';
import 'package:traderscircuit/model/Notification/notification_model.dart';

GetNotification?notificationobj;

class NotificationsAPI {
  Future<ResponseData<dynamic>> notificationList(
      {required StreamController<GetNotification> streamControl}) async {
    final response = await NetworkApiServices().getApi(ApiUrls.notificationApi);
    if (response.status == ResponseStatus.SUCCESS) {
      notificationobj = GetNotification.fromJson(response.data);
      if (!streamControl.isClosed) streamControl.sink.add(notificationobj!);
    }
    return response;
  }

  // Future<ResponseData<dynamic>> PostnotificationAPI(slug) async {
  //   final response =
  //       await NetworkApi().postslugApi(ApiUrls.postnotifications + "/${slug}");
  //   print("Url is ${ApiUrls.postnotifications + "/${slug}"}");
  //   return response;
  // }
}
