feat(ratings): Wallapop-style ratings in chat and offer detail

- SocialSession grows a ratings transport (fifth interface on the one
  shared channel).
- PeerRatingCubit: count, locale-aware average, and circleCount — how
  many ratings come from your own circle (reuses the ego-centric trust
  rule), the signal that makes strangers' review-stuffing irrelevant.
- Chat: slim rating strip under the trust banner; you can rate only
  someone you've talked with (soft anchor until the signed bilateral
  exchange form lands). Sheet with 5 stars + optional comment,
  pre-filled for editing, with a take-back action.
- Offer detail: author's stars under their name, with 'N from people
  you know' when your circle rated them; nothing shown when unrated.
- i18n ratings.* (en/es/pt/ast); tests for cubit and sheet.
This commit is contained in:
vjrj 2026-07-11 13:13:43 +02:00
parent a24831530d
commit 7e7340d643
18 changed files with 873 additions and 12 deletions

View file

@ -77,6 +77,7 @@ class TranslationsPt extends Translations with BaseTranslations<AppLocale, Trans
@override late final _Translations$chat$pt chat = _Translations$chat$pt._(_root);
@override late final _Translations$trust$pt trust = _Translations$trust$pt._(_root);
@override late final _Translations$yourPeople$pt yourPeople = _Translations$yourPeople$pt._(_root);
@override late final _Translations$ratings$pt ratings = _Translations$ratings$pt._(_root);
@override late final _Translations$notifications$pt notifications = _Translations$notifications$pt._(_root);
@override late final _Translations$plantare$pt plantare = _Translations$plantare$pt._(_root);
@override late final _Translations$sale$pt sale = _Translations$sale$pt._(_root);
@ -805,6 +806,21 @@ class _Translations$yourPeople$pt extends Translations$yourPeople$en {
@override String get offline => 'Sem ligação — tenta novamente quando estiveres em linha';
}
// Path: ratings
class _Translations$ratings$pt extends Translations$ratings$en {
_Translations$ratings$pt._(TranslationsPt root) : this._root = root, super.internal(root);
final TranslationsPt _root; // ignore: unused_field
// Translations
@override String get rate => 'Avaliar esta pessoa';
@override String get edit => 'Editar a tua avaliação';
@override String get commentHint => 'Como correu? (opcional)';
@override String fromYourCircle({required Object n}) => '${n} de pessoas que conheces';
@override String get retract => 'Remover a tua avaliação';
@override String get saved => 'Avaliação guardada';
}
// Path: notifications
class _Translations$notifications$pt extends Translations$notifications$en {
_Translations$notifications$pt._(TranslationsPt root) : this._root = root, super.internal(root);
@ -1625,6 +1641,12 @@ extension on TranslationsPt {
'yourPeople.revoke' => 'Deixar de avalizar',
'yourPeople.revokeConfirm' => 'Deixar de avalizar esta pessoa?',
'yourPeople.offline' => 'Sem ligação — tenta novamente quando estiveres em linha',
'ratings.rate' => 'Avaliar esta pessoa',
'ratings.edit' => 'Editar a tua avaliação',
'ratings.commentHint' => 'Como correu? (opcional)',
'ratings.fromYourCircle' => ({required Object n}) => '${n} de pessoas que conheces',
'ratings.retract' => 'Remover a tua avaliação',
'ratings.saved' => 'Avaliação guardada',
'notifications.newMessageFrom' => ({required Object name}) => 'Nova mensagem de ${name}',
'plantare.title' => 'Plantares',
'plantare.help' => 'Um Plantare é o compromisso de reproduzir uma semente e devolver uma parte — assim uma variedade continua a viajar de mão em mão. Não é uma venda.',