readSingleNotifications method
- String id
Implementation
Future<bool> readSingleNotifications(String id) async {
var response = await Requests.getDio().put("notifications/read/$id");
if (response.statusCode == 200) {
await getNotifications();
return true;
} else {
CustomFlashWidget.showFlashMessage(
type: FlashType.error,
title: "Error",
message: response.data?["errorCode"] ??
response.data?["message"]?["errorCode"] ??
"Something unexpected happened. Please try again later!",
);
return false;
}
}