feat(market): save others' offers as favorites (Wallapop-style)

Adds a Favorites feature: a heart on the offer detail saves another
person's listing to an encrypted, per-identity SavedOffersStore
(keystore JSON snapshot, no plaintext at rest). A new /favorites screen
(wired from the drawer) lists saved offers offline-first and, when a
relay is reachable, flags ones that are gone as "no longer available".
i18n en/es/pt/ast; store + screen + detail-heart tests.
This commit is contained in:
vjrj 2026-07-13 08:21:43 +02:00
parent f6967e8cbb
commit d6225eed38
19 changed files with 806 additions and 3 deletions

View file

@ -5,6 +5,13 @@
"illustration": "O escueyi un dibuxu",
"remove": "Quitar"
},
"favorites": {
"title": "Favoritos",
"empty": "Entá nun tienes favoritos. Guarda ofertes que te presten del mercáu.",
"save": "Guardar en favoritos",
"remove": "Quitar de favoritos",
"unavailable": "Yá nun ta disponible"
},
"seedSaving": {
"title": "Guardar la so semiente",
"subtitle": "Lo que fai falta pa caltener la variedá fiel",

View file

@ -5,6 +5,13 @@
"illustration": "Or pick an illustration",
"remove": "Remove"
},
"favorites": {
"title": "Favorites",
"empty": "No favorites yet. Save offers you like from the market.",
"save": "Save to favorites",
"remove": "Remove from favorites",
"unavailable": "No longer available"
},
"seedSaving": {
"title": "Saving its seed",
"subtitle": "What it takes to keep the variety true",

View file

@ -5,6 +5,13 @@
"illustration": "O elige un dibujo",
"remove": "Quitar"
},
"favorites": {
"title": "Favoritos",
"empty": "Aún no tienes favoritos. Guarda ofertas que te gusten del mercado.",
"save": "Guardar en favoritos",
"remove": "Quitar de favoritos",
"unavailable": "Ya no está disponible"
},
"seedSaving": {
"title": "Conservar su semilla",
"subtitle": "Lo que hace falta para mantener la variedad fiel",

View file

@ -5,6 +5,13 @@
"illustration": "Ou escolhe um desenho",
"remove": "Remover"
},
"favorites": {
"title": "Favoritos",
"empty": "Ainda não tens favoritos. Guarda ofertas que gostes do mercado.",
"save": "Guardar nos favoritos",
"remove": "Remover dos favoritos",
"unavailable": "Já não está disponível"
},
"seedSaving": {
"title": "Guardar a sua semente",
"subtitle": "O que é preciso para manter a variedade fiel",

View file

@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 4
/// Strings: 2032 (508 per locale)
/// Strings: 2052 (513 per locale)
///
/// Built on 2026-07-12 at 10:59 UTC
/// Built on 2026-07-13 at 05:54 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import

View file

@ -40,6 +40,7 @@ class TranslationsAst extends Translations with BaseTranslations<AppLocale, Tran
// Translations
@override late final _Translations$avatar$ast avatar = _Translations$avatar$ast._(_root);
@override late final _Translations$favorites$ast favorites = _Translations$favorites$ast._(_root);
@override late final _Translations$seedSaving$ast seedSaving = _Translations$seedSaving$ast._(_root);
@override late final _Translations$calendar$ast calendar = _Translations$calendar$ast._(_root);
@override late final _Translations$app$ast app = _Translations$app$ast._(_root);
@ -99,6 +100,20 @@ class _Translations$avatar$ast extends Translations$avatar$en {
@override String get remove => 'Quitar';
}
// Path: favorites
class _Translations$favorites$ast extends Translations$favorites$en {
_Translations$favorites$ast._(TranslationsAst root) : this._root = root, super.internal(root);
final TranslationsAst _root; // ignore: unused_field
// Translations
@override String get title => 'Favoritos';
@override String get empty => 'Entá nun tienes favoritos. Guarda ofertes que te presten del mercáu.';
@override String get save => 'Guardar en favoritos';
@override String get remove => 'Quitar de favoritos';
@override String get unavailable => 'Yá nun ta disponible';
}
// Path: seedSaving
class _Translations$seedSaving$ast extends Translations$seedSaving$en {
_Translations$seedSaving$ast._(TranslationsAst root) : this._root = root, super.internal(root);
@ -1312,6 +1327,11 @@ extension on TranslationsAst {
'avatar.fromPhoto' => 'Facer o escoyer una semeya',
'avatar.illustration' => 'O escueyi un dibuxu',
'avatar.remove' => 'Quitar',
'favorites.title' => 'Favoritos',
'favorites.empty' => 'Entá nun tienes favoritos. Guarda ofertes que te presten del mercáu.',
'favorites.save' => 'Guardar en favoritos',
'favorites.remove' => 'Quitar de favoritos',
'favorites.unavailable' => 'Yá nun ta disponible',
'seedSaving.title' => 'Guardar la so semiente',
'seedSaving.subtitle' => 'Lo que fai falta pa caltener la variedá fiel',
'seedSaving.lifeCycle' => 'Ciclu',

View file

@ -41,6 +41,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
// Translations
late final Translations$avatar$en avatar = Translations$avatar$en.internal(_root);
late final Translations$favorites$en favorites = Translations$favorites$en.internal(_root);
late final Translations$seedSaving$en seedSaving = Translations$seedSaving$en.internal(_root);
late final Translations$calendar$en calendar = Translations$calendar$en.internal(_root);
late final Translations$app$en app = Translations$app$en.internal(_root);
@ -108,6 +109,30 @@ class Translations$avatar$en {
String get remove => 'Remove';
}
// Path: favorites
class Translations$favorites$en {
Translations$favorites$en.internal(this._root);
final Translations _root; // ignore: unused_field
// Translations
/// en: 'Favorites'
String get title => 'Favorites';
/// en: 'No favorites yet. Save offers you like from the market.'
String get empty => 'No favorites yet. Save offers you like from the market.';
/// en: 'Save to favorites'
String get save => 'Save to favorites';
/// en: 'Remove from favorites'
String get remove => 'Remove from favorites';
/// en: 'No longer available'
String get unavailable => 'No longer available';
}
// Path: seedSaving
class Translations$seedSaving$en {
Translations$seedSaving$en.internal(this._root);
@ -2315,6 +2340,11 @@ extension on Translations {
'avatar.fromPhoto' => 'Take or choose a photo',
'avatar.illustration' => 'Or pick an illustration',
'avatar.remove' => 'Remove',
'favorites.title' => 'Favorites',
'favorites.empty' => 'No favorites yet. Save offers you like from the market.',
'favorites.save' => 'Save to favorites',
'favorites.remove' => 'Remove from favorites',
'favorites.unavailable' => 'No longer available',
'seedSaving.title' => 'Saving its seed',
'seedSaving.subtitle' => 'What it takes to keep the variety true',
'seedSaving.lifeCycle' => 'Cycle',
@ -2818,6 +2848,8 @@ extension on Translations {
'sale.currencyHint' => '€, Ğ1, hours… (optional)',
'sale.hours' => 'hours',
'sale.note' => 'Note (optional)',
_ => null,
} ?? switch (path) {
'sale.save' => 'Save',
'sale.delete' => 'Remove',
'sale.removeConfirm' => 'Remove this sale?',

View file

@ -40,6 +40,7 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
// Translations
@override late final _Translations$avatar$es avatar = _Translations$avatar$es._(_root);
@override late final _Translations$favorites$es favorites = _Translations$favorites$es._(_root);
@override late final _Translations$seedSaving$es seedSaving = _Translations$seedSaving$es._(_root);
@override late final _Translations$calendar$es calendar = _Translations$calendar$es._(_root);
@override late final _Translations$app$es app = _Translations$app$es._(_root);
@ -99,6 +100,20 @@ class _Translations$avatar$es extends Translations$avatar$en {
@override String get remove => 'Quitar';
}
// Path: favorites
class _Translations$favorites$es extends Translations$favorites$en {
_Translations$favorites$es._(TranslationsEs root) : this._root = root, super.internal(root);
final TranslationsEs _root; // ignore: unused_field
// Translations
@override String get title => 'Favoritos';
@override String get empty => 'Aún no tienes favoritos. Guarda ofertas que te gusten del mercado.';
@override String get save => 'Guardar en favoritos';
@override String get remove => 'Quitar de favoritos';
@override String get unavailable => 'Ya no está disponible';
}
// Path: seedSaving
class _Translations$seedSaving$es extends Translations$seedSaving$en {
_Translations$seedSaving$es._(TranslationsEs root) : this._root = root, super.internal(root);
@ -1314,6 +1329,11 @@ extension on TranslationsEs {
'avatar.fromPhoto' => 'Hacer o elegir una foto',
'avatar.illustration' => 'O elige un dibujo',
'avatar.remove' => 'Quitar',
'favorites.title' => 'Favoritos',
'favorites.empty' => 'Aún no tienes favoritos. Guarda ofertas que te gusten del mercado.',
'favorites.save' => 'Guardar en favoritos',
'favorites.remove' => 'Quitar de favoritos',
'favorites.unavailable' => 'Ya no está disponible',
'seedSaving.title' => 'Conservar su semilla',
'seedSaving.subtitle' => 'Lo que hace falta para mantener la variedad fiel',
'seedSaving.lifeCycle' => 'Ciclo',
@ -1817,6 +1837,8 @@ extension on TranslationsEs {
'sale.hours' => 'horas',
'sale.note' => 'Nota (opcional)',
'sale.save' => 'Guardar',
_ => null,
} ?? switch (path) {
'sale.delete' => 'Quitar',
'sale.removeConfirm' => '¿Quitar esta venta?',
_ => null,

View file

@ -40,6 +40,7 @@ class TranslationsPt extends Translations with BaseTranslations<AppLocale, Trans
// Translations
@override late final _Translations$avatar$pt avatar = _Translations$avatar$pt._(_root);
@override late final _Translations$favorites$pt favorites = _Translations$favorites$pt._(_root);
@override late final _Translations$seedSaving$pt seedSaving = _Translations$seedSaving$pt._(_root);
@override late final _Translations$calendar$pt calendar = _Translations$calendar$pt._(_root);
@override late final _Translations$app$pt app = _Translations$app$pt._(_root);
@ -99,6 +100,20 @@ class _Translations$avatar$pt extends Translations$avatar$en {
@override String get remove => 'Remover';
}
// Path: favorites
class _Translations$favorites$pt extends Translations$favorites$en {
_Translations$favorites$pt._(TranslationsPt root) : this._root = root, super.internal(root);
final TranslationsPt _root; // ignore: unused_field
// Translations
@override String get title => 'Favoritos';
@override String get empty => 'Ainda não tens favoritos. Guarda ofertas que gostes do mercado.';
@override String get save => 'Guardar nos favoritos';
@override String get remove => 'Remover dos favoritos';
@override String get unavailable => 'Já não está disponível';
}
// Path: seedSaving
class _Translations$seedSaving$pt extends Translations$seedSaving$en {
_Translations$seedSaving$pt._(TranslationsPt root) : this._root = root, super.internal(root);
@ -1311,6 +1326,11 @@ extension on TranslationsPt {
'avatar.fromPhoto' => 'Tirar ou escolher uma foto',
'avatar.illustration' => 'Ou escolhe um desenho',
'avatar.remove' => 'Remover',
'favorites.title' => 'Favoritos',
'favorites.empty' => 'Ainda não tens favoritos. Guarda ofertas que gostes do mercado.',
'favorites.save' => 'Guardar nos favoritos',
'favorites.remove' => 'Remover dos favoritos',
'favorites.unavailable' => 'Já não está disponível',
'seedSaving.title' => 'Guardar a sua semente',
'seedSaving.subtitle' => 'O que é preciso para manter a variedade fiel',
'seedSaving.lifeCycle' => 'Ciclo',