2024-04-12 19:34:25 +05:30
|
|
|
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';
|
|
|
|
|
|
2024-04-16 19:39:01 +05:30
|
|
|
GetNotification?notificationobj;
|
2024-04-12 19:34:25 +05:30
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
// }
|
|
|
|
|
}
|