CallLog.fromJson constructor

CallLog.fromJson(
  1. Map<String, dynamic> json
)

Factory constructor that creates a CallLog instance from a JSON map.

This constructor parses a JSON map and initializes a CallLog instance with the values from the map. It is used for decoding JSON data fetched from an API or stored locally.

json: The JSON map to parse.

Implementation

factory CallLog.fromJson(Map<String, dynamic> json) => CallLog(
    callMode: json["callMode"],
    callState: Platform.isAndroid
        ? json['callState']
        : getCallState(stateValue: json['callState']),
    callTime: json["callTime"],
    callType: json["callType"],
    callerDevice: json["callerDevice"],
    endTime: json["endTime"],
    fromUser: json["fromUser"],
    groupId: json["groupId"],
    inviteUserList: json["inviteUserList"] == null
        ? []
        : List<String>.from(json["inviteUserList"]!.map((x) => x)),
    isCarbonAnswered: json["isCarbonAnswered"],
    isDeleted: json["isDeleted"],
    isDisplay: json["isDisplay"],
    isSync: json["isSync"],
    roomId: json["roomId"],
    rowId: json["rowId"],
    sessionStatus: json["sessionStatus"],
    startTime: json["startTime"],
    toUser: json["toUser"],
    userList: json["userList"] == null
        ? []
        : List<String>.from(json["userList"]!.map((x) => x)),
    nickName: json['nickName']);