* docs: add User Feedback section to toolbar reading assistance instructions Describes the shared feedback pattern for word cards (existing) and translations (planned). References #5838. * feat: allow users to flag translations * make flag button smaller --------- Co-authored-by: ggurdin <ggurdin@gmail.com>
32 lines
884 B
Dart
32 lines
884 B
Dart
import 'package:fluffychat/pangea/common/constants/model_keys.dart';
|
|
|
|
class FullTextTranslationResponseModel {
|
|
final List<String> translations;
|
|
final String translation;
|
|
final String source;
|
|
|
|
const FullTextTranslationResponseModel({
|
|
required this.translation,
|
|
required this.translations,
|
|
required this.source,
|
|
});
|
|
|
|
factory FullTextTranslationResponseModel.fromJson(Map<String, dynamic> json) {
|
|
return FullTextTranslationResponseModel(
|
|
translation: json['translation'] as String,
|
|
translations: (json["translations"] as Iterable)
|
|
.map<String>((e) => e)
|
|
.toList()
|
|
.cast<String>(),
|
|
source: json[ModelKey.srcLang],
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'translation': translation,
|
|
'translations': translations,
|
|
ModelKey.srcLang: source,
|
|
};
|
|
|
|
String get bestTranslation => translation;
|
|
}
|