fluffychat/lib/pangea/translation/full_text_translation_response_model.dart
wcjord 38e908c33c
docs: add User Feedback section to toolbar reading assistance instructions (#5839)
* 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>
2026-03-02 13:01:03 -05:00

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;
}