create static method

SocketError create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "socketError",
  3. String? message,
  4. String? description,
  5. String? error,
})
override

return original data json

Implementation

static SocketError create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "socketError",
  String? message,
  String? description,
  String? error,
}) {
  // SocketError socketError = SocketError({
  final Map socketError_data_create_json = {
    "@type": special_type,
    "message": message,
    "description": description,
    "error": error,
  };

  socketError_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (socketError_data_create_json.containsKey(key) == false) {
        socketError_data_create_json[key] = value;
      }
    });
  }
  return SocketError(socketError_data_create_json);
}