Merge pull request #1941 from daisukeueta/master

Added == operator and hashCode to WebUri
This commit is contained in:
Lorenzo Pichilli 2023-12-25 18:05:35 +01:00 committed by GitHub
commit 616dcaf7a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -188,6 +188,23 @@ class WebUri implements Uri {
@override
String get userInfo => _uri.userInfo;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is WebUri &&
runtimeType == other.runtimeType &&
_uri == other._uri &&
_rawValue == other._rawValue &&
_isValidUri == other._isValidUri &&
forceToStringRawValue == other.forceToStringRawValue;
@override
int get hashCode =>
_uri.hashCode ^
_rawValue.hashCode ^
_isValidUri.hashCode ^
forceToStringRawValue.hashCode;
///If [forceToStringRawValue] is `true` or [isValidUri] is `false`, it returns [rawValue],
///otherwise the value of [uriValue]`.toString()`.
@override