Re-add custom hashCode and == on MessageConfig, fixing constant MessageController reloads due to room changing
This commit is contained in:
parent
cdba3c480e
commit
08cca4d3d3
1 changed files with 10 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ part "message_config.g.dart";
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class MessageConfig with _$MessageConfig {
|
abstract class MessageConfig with _$MessageConfig {
|
||||||
|
const MessageConfig._();
|
||||||
const factory MessageConfig({
|
const factory MessageConfig({
|
||||||
@Default(false) bool alwaysReturn,
|
@Default(false) bool alwaysReturn,
|
||||||
@Default(false) bool includeEdits,
|
@Default(false) bool includeEdits,
|
||||||
|
|
@ -13,6 +14,15 @@ abstract class MessageConfig with _$MessageConfig {
|
||||||
required Event event,
|
required Event event,
|
||||||
}) = _MessageConfig;
|
}) = _MessageConfig;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
other.runtimeType == runtimeType &&
|
||||||
|
other is MessageConfig &&
|
||||||
|
other.event == event;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => Object.hash(runtimeType, event);
|
||||||
|
|
||||||
factory MessageConfig.fromJson(Map<String, Object?> json) =>
|
factory MessageConfig.fromJson(Map<String, Object?> json) =>
|
||||||
_$MessageConfigFromJson(json);
|
_$MessageConfigFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue