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