feat(block2): 'use my location' — set the sharing area without typing a code

Makes the coarse area human, per feedback that a typed code is jargon.
- CoarseLocationProvider interface + geolocator-backed impl (BSD-3): low
  accuracy only, returns null on any denial/error (degrades quietly). Behind an
  interface so it's fakeable and the plugin stays at the composition root.
- Config sheet: a 'Use my approximate location' button (shown only when a
  provider is wired) fills the area from the device position, reduced to a
  5-char geohash via commons_core's Geohash — a precise fix never leaves the
  device. 'Couldn't get your location' on failure.
- Threaded via TaneApp(location); main wires GeolocatorCoarseLocation.
- Platform: ACCESS_COARSE_LOCATION (Android) + NSLocationWhenInUseUsageDescription
  (iOS), both scoped to the coarse-area use.
- i18n en/es/pt. Widget test fills the area from a fake location. 8 tests green.
This commit is contained in:
vjrj 2026-07-10 10:25:44 +02:00
parent 6195bece4a
commit bf0e770aae
15 changed files with 176 additions and 10 deletions

View file

@ -351,6 +351,8 @@
"wanted": "Wanted",
"shareMine": "Share my seeds",
"sharedCount": "Shared {n} seeds nearby",
"nothingToShare": "Mark some seeds to give, swap or sell first"
"nothingToShare": "Mark some seeds to give, swap or sell first",
"useLocation": "Use my approximate location",
"locationFailed": "Couldn't get your location"
}
}

View file

@ -351,6 +351,8 @@
"wanted": "Busco",
"shareMine": "Compartir mis semillas",
"sharedCount": "Compartidas {n} semillas",
"nothingToShare": "Marca antes algunas semillas para regalar, cambiar o vender"
"nothingToShare": "Marca antes algunas semillas para regalar, cambiar o vender",
"useLocation": "Usar mi ubicación aproximada",
"locationFailed": "No se pudo obtener tu ubicación"
}
}

View file

@ -347,6 +347,8 @@
"wanted": "Procuro",
"shareMine": "Partilhar as minhas sementes",
"sharedCount": "Partilhadas {n} sementes",
"nothingToShare": "Marca primeiro algumas sementes para dar, trocar ou vender"
"nothingToShare": "Marca primeiro algumas sementes para dar, trocar ou vender",
"useLocation": "Usar a minha localização aproximada",
"locationFailed": "Não foi possível obter a tua localização"
}
}

View file

@ -4,9 +4,9 @@
/// To regenerate, run: `dart run slang`
///
/// Locales: 3
/// Strings: 938 (312 per locale)
/// Strings: 944 (314 per locale)
///
/// Built on 2026-07-10 at 08:17 UTC
/// Built on 2026-07-10 at 08:25 UTC
// coverage:ignore-file
// ignore_for_file: type=lint, unused_import

View file

@ -1114,6 +1114,12 @@ class Translations$market$en {
/// en: 'Mark some seeds to give, swap or sell first'
String get nothingToShare => 'Mark some seeds to give, swap or sell first';
/// en: 'Use my approximate location'
String get useLocation => 'Use my approximate location';
/// en: 'Couldn't get your location'
String get locationFailed => 'Couldn\'t get your location';
}
// Path: intro.slides
@ -1887,6 +1893,8 @@ extension on Translations {
'market.shareMine' => 'Share my seeds',
'market.sharedCount' => ({required Object n}) => 'Shared ${n} seeds nearby',
'market.nothingToShare' => 'Mark some seeds to give, swap or sell first',
'market.useLocation' => 'Use my approximate location',
'market.locationFailed' => 'Couldn\'t get your location',
_ => null,
};
}

View file

@ -622,6 +622,8 @@ class _Translations$market$es extends Translations$market$en {
@override String get shareMine => 'Compartir mis semillas';
@override String sharedCount({required Object n}) => 'Compartidas ${n} semillas';
@override String get nothingToShare => 'Marca antes algunas semillas para regalar, cambiar o vender';
@override String get useLocation => 'Usar mi ubicación aproximada';
@override String get locationFailed => 'No se pudo obtener tu ubicación';
}
// Path: intro.slides
@ -1279,6 +1281,8 @@ extension on TranslationsEs {
'market.shareMine' => 'Compartir mis semillas',
'market.sharedCount' => ({required Object n}) => 'Compartidas ${n} semillas',
'market.nothingToShare' => 'Marca antes algunas semillas para regalar, cambiar o vender',
'market.useLocation' => 'Usar mi ubicación aproximada',
'market.locationFailed' => 'No se pudo obtener tu ubicación',
_ => null,
};
}

View file

@ -618,6 +618,8 @@ class _Translations$market$pt extends Translations$market$en {
@override String get shareMine => 'Partilhar as minhas sementes';
@override String sharedCount({required Object n}) => 'Partilhadas ${n} sementes';
@override String get nothingToShare => 'Marca primeiro algumas sementes para dar, trocar ou vender';
@override String get useLocation => 'Usar a minha localização aproximada';
@override String get locationFailed => 'Não foi possível obter a tua localização';
}
// Path: intro.slides
@ -1271,6 +1273,8 @@ extension on TranslationsPt {
'market.shareMine' => 'Partilhar as minhas sementes',
'market.sharedCount' => ({required Object n}) => 'Partilhadas ${n} sementes',
'market.nothingToShare' => 'Marca primeiro algumas sementes para dar, trocar ou vender',
'market.useLocation' => 'Usar a minha localização aproximada',
'market.locationFailed' => 'Não foi possível obter a tua localização',
_ => null,
};
}