chat cont.
parent
d2665fd10f
commit
ec28f8992c
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,137 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
ChatUserModel chatUserModelFromJson(String str) => ChatUserModel.fromJson(json.decode(str));
|
||||
|
||||
String chatUserModelToJson(ChatUserModel data) => json.encode(data.toJson());
|
||||
|
||||
class ChatUserModel {
|
||||
ChatUserModel({
|
||||
this.response,
|
||||
this.errorResponses,
|
||||
});
|
||||
|
||||
List<ChatUser>? response;
|
||||
List<ErrorResponse>? errorResponses;
|
||||
|
||||
factory ChatUserModel.fromJson(Map<String, dynamic> json) => ChatUserModel(
|
||||
response: json["response"] == null ? null : List<ChatUser>.from(json["response"].map((x) => ChatUser.fromJson(x))),
|
||||
errorResponses: json["errorResponses"] == null ? null : List<ErrorResponse>.from(json["errorResponses"].map((x) => ErrorResponse.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"response": response == null ? null : List<dynamic>.from(response!.map((x) => x.toJson())),
|
||||
"errorResponses": errorResponses == null ? null : List<dynamic>.from(errorResponses!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class ErrorResponse {
|
||||
ErrorResponse({
|
||||
this.fieldName,
|
||||
this.message,
|
||||
});
|
||||
|
||||
dynamic? fieldName;
|
||||
String? message;
|
||||
|
||||
factory ErrorResponse.fromRawJson(String str) => ErrorResponse.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory ErrorResponse.fromJson(Map<String, dynamic> json) => ErrorResponse(
|
||||
fieldName: json["fieldName"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"fieldName": fieldName,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
|
||||
class ChatUser {
|
||||
ChatUser({
|
||||
this.id,
|
||||
this.userName,
|
||||
this.email,
|
||||
this.phone,
|
||||
this.title,
|
||||
this.userStatus,
|
||||
this.image,
|
||||
this.unreadMessageCount,
|
||||
this.userAction,
|
||||
this.isPin,
|
||||
this.isFav,
|
||||
this.isAdmin,
|
||||
this.rKey,
|
||||
this.totalCount,
|
||||
this.isTyping,
|
||||
this.isImageLoaded,
|
||||
this.isImageLoading,
|
||||
this.userLocalDownlaodedImage,
|
||||
this.isChecked
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? userName;
|
||||
String? email;
|
||||
dynamic? phone;
|
||||
String? title;
|
||||
int? userStatus;
|
||||
dynamic? image;
|
||||
int? unreadMessageCount;
|
||||
dynamic? userAction;
|
||||
bool? isPin;
|
||||
bool? isFav;
|
||||
bool? isAdmin;
|
||||
dynamic? rKey;
|
||||
int? totalCount;
|
||||
bool? isTyping;
|
||||
bool? isImageLoaded;
|
||||
bool? isImageLoading;
|
||||
File? userLocalDownlaodedImage;
|
||||
bool? isChecked;
|
||||
factory ChatUser.fromRawJson(String str) => ChatUser.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory ChatUser.fromJson(Map<String, dynamic> json) => ChatUser(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
userName: json["userName"] == null ? null : json["userName"],
|
||||
email: json["email"] == null ? null : json["email"],
|
||||
phone: json["phone"],
|
||||
title: json["title"] == null ? null : json["title"],
|
||||
userStatus: json["userStatus"] == null ? null : json["userStatus"],
|
||||
image: json["image"],
|
||||
unreadMessageCount: json["unreadMessageCount"] == null ? null : json["unreadMessageCount"],
|
||||
userAction: json["userAction"],
|
||||
isPin: json["isPin"] == null ? null : json["isPin"],
|
||||
isFav: json["isFav"] == null ? null : json["isFav"],
|
||||
isAdmin: json["isAdmin"] == null ? null : json["isAdmin"],
|
||||
rKey: json["rKey"],
|
||||
totalCount: json["totalCount"] == null ? null : json["totalCount"],
|
||||
isTyping: false,
|
||||
isImageLoaded: false,
|
||||
isImageLoading: true,
|
||||
userLocalDownlaodedImage: null,
|
||||
isChecked: false
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"userName": userName == null ? null : userName,
|
||||
"email": email == null ? null : email,
|
||||
"phone": phone,
|
||||
"title": title == null ? null : title,
|
||||
"userStatus": userStatus == null ? null : userStatus,
|
||||
"image": image,
|
||||
"unreadMessageCount": unreadMessageCount == null ? null : unreadMessageCount,
|
||||
"userAction": userAction,
|
||||
"isPin": isPin == null ? null : isPin,
|
||||
"isFav": isFav == null ? null : isFav,
|
||||
"isAdmin": isAdmin == null ? null : isAdmin,
|
||||
"rKey": rKey,
|
||||
"totalCount": totalCount == null ? null : totalCount,
|
||||
"isChecked":isChecked
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,206 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:just_audio/just_audio.dart';
|
||||
|
||||
List<SingleUserChatModel> singleUserChatModelFromJson(String str) => List<SingleUserChatModel>.from(json.decode(str).map((x) => SingleUserChatModel.fromJson(x)));
|
||||
|
||||
String singleUserChatModelToJson(List<SingleUserChatModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||
|
||||
class SingleUserChatModel {
|
||||
SingleUserChatModel(
|
||||
{this.userChatHistoryId,
|
||||
this.userChatHistoryLineId,
|
||||
this.contant,
|
||||
this.contantNo,
|
||||
this.currentUserId,
|
||||
this.currentUserName,
|
||||
this.targetUserId,
|
||||
this.targetUserName,
|
||||
this.encryptedTargetUserId,
|
||||
this.encryptedTargetUserName,
|
||||
this.currentUserEmail,
|
||||
this.targetUserEmail,
|
||||
this.chatEventId,
|
||||
this.fileTypeId,
|
||||
this.isSeen,
|
||||
this.isDelivered,
|
||||
this.createdDate,
|
||||
this.chatSource,
|
||||
this.conversationId,
|
||||
this.fileTypeResponse,
|
||||
this.userChatReplyResponse,
|
||||
this.isReplied,
|
||||
this.isImageLoaded,
|
||||
this.image,
|
||||
this.voice,
|
||||
this.voiceController});
|
||||
|
||||
int? userChatHistoryId;
|
||||
int? userChatHistoryLineId;
|
||||
String? contant;
|
||||
String? contantNo;
|
||||
int? currentUserId;
|
||||
String? currentUserName;
|
||||
String? currentUserEmail;
|
||||
int? targetUserId;
|
||||
String? targetUserName;
|
||||
String? targetUserEmail;
|
||||
String? encryptedTargetUserId;
|
||||
String? encryptedTargetUserName;
|
||||
int? chatEventId;
|
||||
dynamic? fileTypeId;
|
||||
bool? isSeen;
|
||||
bool? isDelivered;
|
||||
DateTime? createdDate;
|
||||
int? chatSource;
|
||||
String? conversationId;
|
||||
FileTypeResponse? fileTypeResponse;
|
||||
UserChatReplyResponse? userChatReplyResponse;
|
||||
bool? isReplied;
|
||||
bool? isImageLoaded;
|
||||
Uint8List? image;
|
||||
File? voice;
|
||||
AudioPlayer? voiceController;
|
||||
|
||||
factory SingleUserChatModel.fromJson(Map<String, dynamic> json) => SingleUserChatModel(
|
||||
userChatHistoryId: json["userChatHistoryId"] == null ? null : json["userChatHistoryId"],
|
||||
userChatHistoryLineId: json["userChatHistoryLineId"] == null ? null : json["userChatHistoryLineId"],
|
||||
contant: json["contant"] == null ? null : json["contant"],
|
||||
contantNo: json["contantNo"] == null ? null : json["contantNo"],
|
||||
currentUserId: json["currentUserId"] == null ? null : json["currentUserId"],
|
||||
currentUserName: json["currentUserName"] == null ? null : json["currentUserName"],
|
||||
targetUserId: json["targetUserId"] == null ? null : json["targetUserId"],
|
||||
targetUserName: json["targetUserName"] == null ? null : json["targetUserName"],
|
||||
targetUserEmail: json["targetUserEmail"] == null ? null : json["targetUserEmail"],
|
||||
currentUserEmail: json["currentUserEmail"] == null ? null : json["currentUserEmail"],
|
||||
encryptedTargetUserId: json["encryptedTargetUserId"] == null ? null : json["encryptedTargetUserId"],
|
||||
encryptedTargetUserName: json["encryptedTargetUserName"] == null ? null : json["encryptedTargetUserName"],
|
||||
chatEventId: json["chatEventId"] == null ? null : json["chatEventId"],
|
||||
fileTypeId: json["fileTypeId"],
|
||||
isSeen: json["isSeen"] == null ? null : json["isSeen"],
|
||||
isDelivered: json["isDelivered"] == null ? null : json["isDelivered"],
|
||||
createdDate: json["createdDate"] == null ? null : DateTime.parse(json["createdDate"]),
|
||||
chatSource: json["chatSource"] == null ? null : json["chatSource"],
|
||||
conversationId: json["conversationId"] == null ? null : json["conversationId"],
|
||||
fileTypeResponse: json["fileTypeResponse"] == null ? null : FileTypeResponse.fromJson(json["fileTypeResponse"]),
|
||||
userChatReplyResponse: json["userChatReplyResponse"] == null ? null : UserChatReplyResponse.fromJson(json["userChatReplyResponse"]),
|
||||
isReplied: false,
|
||||
isImageLoaded: false,
|
||||
image: null,
|
||||
voice: null,
|
||||
voiceController: json["fileTypeId"] == 13 ? AudioPlayer() : null);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"userChatHistoryId": userChatHistoryId == null ? null : userChatHistoryId,
|
||||
"userChatHistoryLineId": userChatHistoryLineId == null ? null : userChatHistoryLineId,
|
||||
"contant": contant == null ? null : contant,
|
||||
"contantNo": contantNo == null ? null : contantNo,
|
||||
"currentUserId": currentUserId == null ? null : currentUserId,
|
||||
"currentUserName": currentUserName == null ? null : currentUserName,
|
||||
"targetUserId": targetUserId == null ? null : targetUserId,
|
||||
"targetUserName": targetUserName == null ? null : targetUserName,
|
||||
"encryptedTargetUserId": encryptedTargetUserId == null ? null : encryptedTargetUserId,
|
||||
"encryptedTargetUserName": encryptedTargetUserName == null ? null : encryptedTargetUserName,
|
||||
"currentUserEmail": currentUserEmail == null ? null : currentUserEmail,
|
||||
"targetUserEmail": targetUserEmail == null ? null : targetUserEmail,
|
||||
"chatEventId": chatEventId == null ? null : chatEventId,
|
||||
"fileTypeId": fileTypeId,
|
||||
"isSeen": isSeen == null ? null : isSeen,
|
||||
"isDelivered": isDelivered == null ? null : isDelivered,
|
||||
"createdDate": createdDate == null ? null : createdDate!.toIso8601String(),
|
||||
"chatSource": chatSource == null ? null : chatSource,
|
||||
"conversationId": conversationId == null ? null : conversationId,
|
||||
"fileTypeResponse": fileTypeResponse == null ? null : fileTypeResponse!.toJson(),
|
||||
"userChatReplyResponse": userChatReplyResponse == null ? null : userChatReplyResponse!.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
class FileTypeResponse {
|
||||
FileTypeResponse({
|
||||
this.fileTypeId,
|
||||
this.fileTypeName,
|
||||
this.fileTypeDescription,
|
||||
this.fileKind,
|
||||
this.fileName,
|
||||
});
|
||||
|
||||
int? fileTypeId;
|
||||
dynamic fileTypeName;
|
||||
dynamic fileTypeDescription;
|
||||
dynamic fileKind;
|
||||
dynamic fileName;
|
||||
|
||||
factory FileTypeResponse.fromJson(Map<String, dynamic> json) => FileTypeResponse(
|
||||
fileTypeId: json["fileTypeId"] == null ? null : json["fileTypeId"],
|
||||
fileTypeName: json["fileTypeName"],
|
||||
fileTypeDescription: json["fileTypeDescription"],
|
||||
fileKind: json["fileKind"],
|
||||
fileName: json["fileName"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"fileTypeId": fileTypeId == null ? null : fileTypeId,
|
||||
"fileTypeName": fileTypeName,
|
||||
"fileTypeDescription": fileTypeDescription,
|
||||
"fileKind": fileKind,
|
||||
"fileName": fileName,
|
||||
};
|
||||
}
|
||||
|
||||
class UserChatReplyResponse {
|
||||
UserChatReplyResponse(
|
||||
{this.userChatHistoryId,
|
||||
this.chatEventId,
|
||||
this.contant,
|
||||
this.contantNo,
|
||||
this.fileTypeId,
|
||||
this.createdDate,
|
||||
this.targetUserId,
|
||||
this.targetUserName,
|
||||
this.fileTypeResponse,
|
||||
this.isImageLoaded,
|
||||
this.image,
|
||||
this.voice});
|
||||
|
||||
int? userChatHistoryId;
|
||||
int? chatEventId;
|
||||
String? contant;
|
||||
String? contantNo;
|
||||
dynamic? fileTypeId;
|
||||
DateTime? createdDate;
|
||||
int? targetUserId;
|
||||
String? targetUserName;
|
||||
FileTypeResponse? fileTypeResponse;
|
||||
bool? isImageLoaded;
|
||||
Uint8List? image;
|
||||
Uint8List? voice;
|
||||
|
||||
factory UserChatReplyResponse.fromJson(Map<String, dynamic> json) => UserChatReplyResponse(
|
||||
userChatHistoryId: json["userChatHistoryId"] == null ? null : json["userChatHistoryId"],
|
||||
chatEventId: json["chatEventId"] == null ? null : json["chatEventId"],
|
||||
contant: json["contant"] == null ? null : json["contant"],
|
||||
contantNo: json["contantNo"] == null ? null : json["contantNo"],
|
||||
fileTypeId: json["fileTypeId"],
|
||||
createdDate: json["createdDate"] == null ? null : DateTime.parse(json["createdDate"]),
|
||||
targetUserId: json["targetUserId"] == null ? null : json["targetUserId"],
|
||||
targetUserName: json["targetUserName"] == null ? null : json["targetUserName"],
|
||||
fileTypeResponse: json["fileTypeResponse"] == null ? null : FileTypeResponse.fromJson(json["fileTypeResponse"]),
|
||||
isImageLoaded: false,
|
||||
image: null,
|
||||
voice: null,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"userChatHistoryId": userChatHistoryId == null ? null : userChatHistoryId,
|
||||
"chatEventId": chatEventId == null ? null : chatEventId,
|
||||
"contant": contant == null ? null : contant,
|
||||
"contantNo": contantNo == null ? null : contantNo,
|
||||
"fileTypeId": fileTypeId,
|
||||
"createdDate": createdDate == null ? null : createdDate!.toIso8601String(),
|
||||
"targetUserId": targetUserId == null ? null : targetUserId,
|
||||
"targetUserName": targetUserName == null ? null : targetUserName,
|
||||
"fileTypeResponse": fileTypeResponse == null ? null : fileTypeResponse!.toJson(),
|
||||
};
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
import 'dart:convert';
|
||||
|
||||
UserAutoLoginModel userAutoLoginModelFromJson(String str) => UserAutoLoginModel.fromJson(json.decode(str));
|
||||
|
||||
String userAutoLoginModelToJson(UserAutoLoginModel data) => json.encode(data.toJson());
|
||||
|
||||
class UserAutoLoginModel {
|
||||
UserAutoLoginModel({this.response, this.errorResponses, this.StatusCode});
|
||||
|
||||
Response? response;
|
||||
List<ErrorResponse>? errorResponses;
|
||||
int? StatusCode;
|
||||
|
||||
factory UserAutoLoginModel.fromJson(Map<String, dynamic> json) => UserAutoLoginModel(
|
||||
response: json["response"] == null ? null : Response.fromJson(json["response"]),
|
||||
StatusCode: json["StatusCode"],
|
||||
errorResponses: json["errorResponses"] == null ? null : List<ErrorResponse>.from(json["errorResponses"].map((x) => ErrorResponse.fromJson(x))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"response": response == null ? null : response!.toJson(),
|
||||
"StatusCode": StatusCode,
|
||||
"errorResponses": errorResponses == null ? null : List<dynamic>.from(errorResponses!.map((x) => x.toJson())),
|
||||
};
|
||||
}
|
||||
|
||||
class Response {
|
||||
Response({
|
||||
this.id,
|
||||
this.userName,
|
||||
this.email,
|
||||
this.phone,
|
||||
this.title,
|
||||
this.token,
|
||||
this.isDomainUser,
|
||||
this.isActiveCode,
|
||||
this.encryptedUserId,
|
||||
this.encryptedUserName,
|
||||
});
|
||||
|
||||
int? id;
|
||||
String? userName;
|
||||
String? email;
|
||||
String? phone;
|
||||
String? title;
|
||||
String? token;
|
||||
bool? isDomainUser;
|
||||
bool? isActiveCode;
|
||||
String? encryptedUserId;
|
||||
String? encryptedUserName;
|
||||
|
||||
factory Response.fromJson(Map<String, dynamic> json) => Response(
|
||||
id: json["id"] == null ? null : json["id"],
|
||||
userName: json["userName"] == null ? null : json["userName"],
|
||||
email: json["email"] == null ? null : json["email"],
|
||||
phone: json["phone"] == null ? null : json["phone"],
|
||||
title: json["title"] == null ? null : json["title"],
|
||||
token: json["token"] == null ? null : json["token"],
|
||||
isDomainUser: json["isDomainUser"] == null ? null : json["isDomainUser"],
|
||||
isActiveCode: json["isActiveCode"] == null ? null : json["isActiveCode"],
|
||||
encryptedUserId: json["encryptedUserId"] == null ? null : json["encryptedUserId"],
|
||||
encryptedUserName: json["encryptedUserName"] == null ? null : json["encryptedUserName"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id == null ? null : id,
|
||||
"userName": userName == null ? null : userName,
|
||||
"email": email == null ? null : email,
|
||||
"phone": phone == null ? null : phone,
|
||||
"title": title == null ? null : title,
|
||||
"token": token == null ? null : token,
|
||||
"isDomainUser": isDomainUser == null ? null : isDomainUser,
|
||||
"isActiveCode": isActiveCode == null ? null : isActiveCode,
|
||||
"encryptedUserId": encryptedUserId == null ? null : encryptedUserId,
|
||||
"encryptedUserName": encryptedUserName == null ? null : encryptedUserName,
|
||||
};
|
||||
}
|
||||
|
||||
class ErrorResponse {
|
||||
ErrorResponse({
|
||||
this.fieldName,
|
||||
this.message,
|
||||
});
|
||||
|
||||
String? fieldName;
|
||||
String? message;
|
||||
|
||||
factory ErrorResponse.fromJson(Map<String, dynamic> json) => ErrorResponse(
|
||||
fieldName: json["fieldName"] == null ? null : json["fieldName"],
|
||||
message: json["message"] == null ? null : json["message"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"fieldName": fieldName == null ? null : fieldName,
|
||||
"message": message == null ? null : message,
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue