// To parse this JSON data, do // // final incomingCallModel = incomingCallModelFromJson(jsonString); import 'dart:convert'; class IncomingCallModel { String? actionColor; String? appName; Args? args; String? avatar; String? backgroundColor; String? backgroundUrl; int? duration; Extra? extra; String? from; String? handle; Args? headers; String? id; bool? isAccepted; bool? isCustomNotification; bool? isCustomSmallExNotification; bool? isShowCallback; bool? isShowLogo; bool? isShowMissedCallNotification; String? nameCaller; String? ringtonePath; String? textAccept; String? textCallback; String? textDecline; String? textMissedCall; int? type; String? uuid; IncomingCallModel({ this.actionColor, this.appName, this.args, this.avatar, this.backgroundColor, this.backgroundUrl, this.duration, this.extra, this.from, this.handle, this.headers, this.id, this.isAccepted, this.isCustomNotification, this.isCustomSmallExNotification, this.isShowCallback, this.isShowLogo, this.isShowMissedCallNotification, this.nameCaller, this.ringtonePath, this.textAccept, this.textCallback, this.textDecline, this.textMissedCall, this.type, this.uuid, }); factory IncomingCallModel.fromRawJson(String str) => IncomingCallModel.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory IncomingCallModel.fromJson(Map json) => IncomingCallModel( actionColor: json["actionColor"], appName: json["appName"], args: json["args"] == null ? null : Args.fromJson(json["args"]), avatar: json["avatar"], backgroundColor: json["backgroundColor"], backgroundUrl: json["backgroundUrl"], duration: json["duration"] == null ? null : json["duration"].toInt(), extra: json["extra"] == null ? null : Extra.fromJson(json["extra"]), from: json["from"], handle: json["handle"], headers: json["headers"] == null ? null : Args.fromJson(json["headers"]), id: json["id"], isAccepted: json["isAccepted"], isCustomNotification: json["isCustomNotification"], isCustomSmallExNotification: json["isCustomSmallExNotification"], isShowCallback: json["isShowCallback"], isShowLogo: json["isShowLogo"], isShowMissedCallNotification: json["isShowMissedCallNotification"], nameCaller: json["nameCaller"], ringtonePath: json["ringtonePath"], textAccept: json["textAccept"], textCallback: json["textCallback"], textDecline: json["textDecline"], textMissedCall: json["textMissedCall"], type: json["type"] == null ? null : json["type"].toInt(), uuid: json["uuid"], ); Map toJson() => { "actionColor": actionColor, "appName": appName, "args": args?.toJson(), "avatar": avatar, "backgroundColor": backgroundColor, "backgroundUrl": backgroundUrl, "duration": duration, "extra": extra?.toJson(), "from": from, "handle": handle, "headers": headers?.toJson(), "id": id, "isAccepted": isAccepted, "isCustomNotification": isCustomNotification, "isCustomSmallExNotification": isCustomSmallExNotification, "isShowCallback": isShowCallback, "isShowLogo": isShowLogo, "isShowMissedCallNotification": isShowMissedCallNotification, "nameCaller": nameCaller, "ringtonePath": ringtonePath, "textAccept": textAccept, "textCallback": textCallback, "textDecline": textDecline, "textMissedCall": textMissedCall, "type": type, "uuid": uuid, }; } class Args { Args(); factory Args.fromRawJson(String str) => Args.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory Args.fromJson(Map json) => Args(); Map toJson() => {}; } class Extra { LoginDetails? loginDetails; bool? isIncomingCall; CallerDetails? callerDetails; String? callType; Extra({ this.loginDetails, this.isIncomingCall, this.callerDetails, this.callType, }); factory Extra.fromRawJson(String str) => Extra.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory Extra.fromJson(Map json) => Extra( loginDetails: json["loginDetails"] == null ? null : LoginDetails.fromJson(json["loginDetails"]), isIncomingCall: json["isIncomingCall"], callType: json["callType"], callerDetails: json["callerDetails"] == null ? null : CallerDetails.fromJson(json["callerDetails"]), ); Map toJson() => { "loginDetails": loginDetails?.toJson(), "isIncomingCall": isIncomingCall, "callType": callType, "callerDetails": callerDetails?.toJson(), }; } class CallerDetails { int? userChatHistoryId; String? contant; FileTypeResponse? fileTypeResponse; String? currentUserName; String? targetUserEmail; String? conversationId; String? encryptedTargetUserId; int? targetUserId; bool? isSeen; int? userChatHistoryLineId; bool? isDelivered; String? targetUserName; int? currentUserId; DateTime? createdDate; String? currentUserEmail; String? contantNo; int? chatEventId; String? encryptedTargetUserName; int? chatSource; CallerDetails({ this.userChatHistoryId, this.contant, this.fileTypeResponse, this.currentUserName, this.targetUserEmail, this.conversationId, this.encryptedTargetUserId, this.targetUserId, this.isSeen, this.userChatHistoryLineId, this.isDelivered, this.targetUserName, this.currentUserId, this.createdDate, this.currentUserEmail, this.contantNo, this.chatEventId, this.encryptedTargetUserName, this.chatSource, }); factory CallerDetails.fromRawJson(String str) => CallerDetails.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory CallerDetails.fromJson(Map json) => CallerDetails( userChatHistoryId: json["userChatHistoryId"] == null ? null : json["userChatHistoryId"].toInt(), contant: json["contant"], fileTypeResponse: json["fileTypeResponse"] == null ? null : FileTypeResponse.fromJson(json["fileTypeResponse"]), currentUserName: json["currentUserName"], targetUserEmail: json["targetUserEmail"], conversationId: json["conversationId"], encryptedTargetUserId: json["encryptedTargetUserId"], targetUserId: json["targetUserId"] == null ? null : json["targetUserId"].toInt(), isSeen: json["isSeen"], userChatHistoryLineId: json["userChatHistoryLineId"] == null ? null : json["userChatHistoryLineId"].toInt(), isDelivered: json["isDelivered"], targetUserName: json["targetUserName"], currentUserId: json["currentUserId"] == null ? null : json["currentUserId"].toInt(), createdDate: json["createdDate"] == null ? null : DateTime.parse(json["createdDate"]), currentUserEmail: json["currentUserEmail"], contantNo: json["contantNo"], chatEventId: json["chatEventId"] == null ? null : json["chatEventId"].toInt(), encryptedTargetUserName: json["encryptedTargetUserName"], chatSource: json["chatSource"] == null ? null : json["chatSource"].toInt(), ); Map toJson() => { "userChatHistoryId": userChatHistoryId, "contant": contant, "fileTypeResponse": fileTypeResponse?.toJson(), "currentUserName": currentUserName, "targetUserEmail": targetUserEmail, "conversationId": conversationId, "encryptedTargetUserId": encryptedTargetUserId, "targetUserId": targetUserId, "isSeen": isSeen, "userChatHistoryLineId": userChatHistoryLineId, "isDelivered": isDelivered, "targetUserName": targetUserName, "currentUserId": currentUserId, "createdDate": createdDate?.toIso8601String(), "currentUserEmail": currentUserEmail, "contantNo": contantNo, "chatEventId": chatEventId, "encryptedTargetUserName": encryptedTargetUserName, "chatSource": chatSource, }; } class FileTypeResponse { int? fileTypeId; FileTypeResponse({ this.fileTypeId, }); factory FileTypeResponse.fromRawJson(String str) => FileTypeResponse.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory FileTypeResponse.fromJson(Map json) => FileTypeResponse( fileTypeId: json["fileTypeId"].toInt(), ); Map toJson() => { "fileTypeId": fileTypeId, }; } class LoginDetails { bool? isActiveCode; int? id; String? encryptedUserName; String? userName; String? title; String? encryptedUserId; String? email; bool? isDomainUser; String? token; LoginDetails({ this.isActiveCode, this.id, this.encryptedUserName, this.userName, this.title, this.encryptedUserId, this.email, this.isDomainUser, this.token, }); factory LoginDetails.fromRawJson(String str) => LoginDetails.fromJson(json.decode(str)); String toRawJson() => json.encode(toJson()); factory LoginDetails.fromJson(Map json) => LoginDetails( isActiveCode: json["isActiveCode"], id: json["id"] == null ? null : json["id"].toInt(), encryptedUserName: json["encryptedUserName"], userName: json["userName"], title: json["title"], encryptedUserId: json["encryptedUserId"], email: json["email"], isDomainUser: json["isDomainUser"], token: json["token"], ); Map toJson() => { "isActiveCode": isActiveCode, "id": id, "encryptedUserName": encryptedUserName, "userName": userName, "title": title, "encryptedUserId": encryptedUserId, "email": email, "isDomainUser": isDomainUser, "token": token, }; }