diff --git a/packages/shorebird_code_push_protocol/lib/src/models/patch.dart b/packages/shorebird_code_push_protocol/lib/src/models/patch.dart index 67ed1432..e4feba30 100644 --- a/packages/shorebird_code_push_protocol/lib/src/models/patch.dart +++ b/packages/shorebird_code_push_protocol/lib/src/models/patch.dart @@ -1,3 +1,4 @@ +import 'package:equatable/equatable.dart'; import 'package:json_annotation/json_annotation.dart'; part 'patch.g.dart'; @@ -8,7 +9,7 @@ part 'patch.g.dart'; /// multiple patches can be published for a given app release version. /// {@endtemplate} @JsonSerializable() -class Patch { +class Patch extends Equatable { /// {@macro patch} const Patch({required this.id, required this.number, this.notes}); @@ -29,4 +30,7 @@ class Patch { /// /// This value is freeform text with no assumptions about content or format. final String? notes; + + @override + List get props => [id, number, notes]; } diff --git a/packages/shorebird_code_push_protocol/test/src/models/patch_test.dart b/packages/shorebird_code_push_protocol/test/src/models/patch_test.dart index d6ab6d82..75a6a271 100644 --- a/packages/shorebird_code_push_protocol/test/src/models/patch_test.dart +++ b/packages/shorebird_code_push_protocol/test/src/models/patch_test.dart @@ -6,6 +6,7 @@ void main() { test('can be (de)serialized', () { const patch = Patch(id: 1, number: 2, notes: 'some notes'); expect(Patch.fromJson(patch.toJson()).toJson(), equals(patch.toJson())); + expect(Patch.fromJson(patch.toJson()), equals(patch)); }); }); }