import 'package:medcify/models/notification_item.dart'; class NotificationResponse{ bool? status; String? message; List? notifications; NotificationResponse.fromJson(Map json){ status = (json["Code"] ?? "0") != "0"; notifications = (json["Data"] != null) ? json["Data"].map((e) => NotificationItem.fromJson(e)).toList() : []; message = json["Message"] ?? "Something went wrong"; } NotificationResponse.withError(String err){ status = false; notifications = []; message = err; } }