Skip to content

Commit

Permalink
fix: override equality operators to allow unit test comparison
Browse files Browse the repository at this point in the history
* Chore: override equality functions

* chore: fix lint errors
  • Loading branch information
OgunwoleOluwatobi committed Mar 31, 2023
1 parent 6b0537f commit 8f09fe2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/src/models/overlay_response.dart
Expand Up @@ -30,6 +30,17 @@ class DialogResponse<T> extends OverlayResponse<T> {
confirmed: confirmed,
data: data,
);

@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DialogResponse<T> &&
runtimeType == other.runtimeType &&
confirmed == other.confirmed &&
data == data;

@override
int get hashCode => Object.hash(confirmed, data);
}

/// The response returned from awaiting a call on the [BottomSheetService]
Expand Down

0 comments on commit 8f09fe2

Please sign in to comment.