From 2fd70ffed808aa541ab9a7e75dac722447ea36a0 Mon Sep 17 00:00:00 2001 From: Ashita Prasad Date: Mon, 24 Apr 2023 08:13:06 +0530 Subject: [PATCH] Added == comparison --- lib/models/request_model.dart | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/lib/models/request_model.dart b/lib/models/request_model.dart index b72ea9ce..ad1ce3c8 100644 --- a/lib/models/request_model.dart +++ b/lib/models/request_model.dart @@ -174,4 +174,43 @@ class RequestModel { "Response: ${responseModel.toString()}" ].join("\n"); } + + @override + bool operator ==(Object other) { + return other is RequestModel && + other.runtimeType == runtimeType && + other.id == id && + other.method == method && + other.url == url && + other.name == name && + other.description == description && + other.requestTabIndex == requestTabIndex && + other.requestHeaders == requestHeaders && + other.requestParams == requestParams && + other.requestBodyContentType == requestBodyContentType && + other.requestBody == requestBody && + other.responseStatus == responseStatus && + other.message == message && + other.responseModel == responseModel; + } + + @override + int get hashCode { + return Object.hash( + runtimeType, + id, + method, + url, + name, + description, + requestTabIndex, + requestHeaders, + requestParams, + requestBodyContentType, + requestBody, + responseStatus, + message, + responseModel, + ); + } }