NotificationSeenFunction method

dynamic NotificationSeenFunction({
  1. dynamic notId,
  2. dynamic type,
  3. dynamic context,
})

Implementation

NotificationSeenFunction({notId, type, context}) async {
  var decodedResponse;
  final ApiBody = {"notification_id": notId.toString(), "update_type": type};
  try {
    http.Response response = await http.post(
      Uri.parse('${BASE_URL}notification_api/update'),
      headers: {
        "Authorization": currentUserToken,
      },
      body: ApiBody,
    );
    decodedResponse = json.decode(response.body);
    SeenStatus = decodedResponse['status'];
  } catch (e) {
    ErrorListner(
        apiname: 'notification_api/update',
        responsed: "${decodedResponse}",
        request: '${ApiBody}',
        app_error: '${e}');
  }
}