mirror of
https://github.com/foss42/apidash.git
synced 2025-05-30 21:41:50 +08:00
Add == for ResponseModel
This commit is contained in:
@ -2,6 +2,7 @@ import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:collection/collection.dart' show mergeMaps;
|
||||
import 'package:http/http.dart';
|
||||
import 'package:http_parser/http_parser.dart';
|
||||
@ -101,4 +102,31 @@ class ResponseModel {
|
||||
"Response Body: $body",
|
||||
].join("\n");
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return other is ResponseModel &&
|
||||
other.runtimeType == runtimeType &&
|
||||
other.statusCode == statusCode &&
|
||||
mapEquals(other.headers, headers) &&
|
||||
mapEquals(other.requestHeaders, requestHeaders) &&
|
||||
other.body == body &&
|
||||
other.formattedBody == formattedBody &&
|
||||
other.bodyBytes == bodyBytes &&
|
||||
other.time == time;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return Object.hash(
|
||||
runtimeType,
|
||||
statusCode,
|
||||
headers,
|
||||
requestHeaders,
|
||||
body,
|
||||
formattedBody,
|
||||
bodyBytes,
|
||||
time,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user