You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fluffychat/lib/pangea/lemmas/lemma_info_response.dart

41 lines
1.0 KiB
Dart

import 'package:fluffychat/pangea/events/models/content_feedback.dart';
class LemmaInfoResponse implements JsonSerializable {
final List<String> emoji;
final String meaning;
LemmaInfoResponse({
required this.emoji,
required this.meaning,
});
factory LemmaInfoResponse.fromJson(Map<String, dynamic> json) {
return LemmaInfoResponse(
emoji: (json['emoji'] as List<dynamic>).map((e) => e as String).toList(),
meaning: json['meaning'] as String,
);
}
@override
Map<String, dynamic> toJson() {
return {
'emoji': emoji,
'meaning': meaning,
};
}
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LemmaInfoResponse &&
runtimeType == other.runtimeType &&
emoji.length == other.emoji.length &&
emoji.every((element) => other.emoji.contains(element)) &&
meaning == other.meaning;
@override
int get hashCode =>
emoji.fold(0, (prev, element) => prev ^ element.hashCode) ^
meaning.hashCode;
}