device infos

This commit is contained in:
2026-08-28 15:07:30 +05:30
parent 5723d373b2
commit 69f4f3e909
84 changed files with 4337 additions and 2339 deletions

View File

@@ -157,6 +157,36 @@ String areaOf(Map<String, dynamic> stop, {bool preferDrop = true}) {
return '';
}
/// Where a stop is **collected from**, as the payload writes it, or `''`.
///
/// ── Why this is not [areaOf] with `preferDrop: false` ──
///
/// [areaOf] answers "which neighbourhood", and deliberately throws away
/// everything that is not a locality name — which is the right answer for a
/// list of twenty stops and the wrong one for the counter the rider is riding
/// to. He needs the street to find the door.
///
/// Three screens were each reading the same four key names for this and one of
/// them, the route card, was reading none of them at all. One reader, so a
/// payload that spells it `pickup_address` cannot answer on the preview sheet
/// and stay blank on the card behind it.
///
/// Returns `''` rather than a placeholder: a card prints nothing where there is
/// no address, which is honest, where "Address not available" is a line of
/// furniture saying the app has failed.
String pickupAddressOf(Map<String, dynamic> stop) {
for (final key in const [
'pickupaddress',
'PickupAddress',
'pickup_address',
'address',
]) {
final raw = (stop[key] ?? '').toString().trim();
if (raw.isNotEmpty && raw.toLowerCase() != 'null') return raw;
}
return '';
}
/// A full address, minus the boilerplate a geocoder appends.
///
/// The record page prints the address in full — it is the one screen whose