fluffychat/lib/pangea/models/content_feedback.dart
wcjord 8084cc24cc
1380 content challenges (#1391)
* use gold consistently for positive xp color

* fix: dont point to local choreo
2025-01-09 14:19:01 -05:00

31 lines
744 B
Dart

abstract class JsonSerializable {
Map<String, dynamic> toJson();
factory JsonSerializable.fromJson(Map<String, dynamic> json) {
throw UnimplementedError();
}
}
class ContentFeedback<T extends JsonSerializable> {
final JsonSerializable content;
final String feedback;
ContentFeedback(this.content, this.feedback);
toJson() {
return {
'content': content.toJson(),
'feedback': feedback,
};
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ContentFeedback &&
runtimeType == other.runtimeType &&
content == other.content &&
feedback == other.feedback;
@override
int get hashCode => content.hashCode ^ feedback.hashCode;
}