mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-06-14 22:55:12 +10:00
reimplement location aware snr-indikator after alpha7
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
import '../connector/meshcore_connector.dart';
|
||||
import '../utils/contact_search.dart';
|
||||
import '../l10n/l10n.dart';
|
||||
import 'signal_ui.dart';
|
||||
|
||||
@@ -158,10 +161,23 @@ class _SNRIndicatorState extends State<SNRIndicator> {
|
||||
widget.connector.currentSf,
|
||||
);
|
||||
final allContacts = widget.connector.allContacts;
|
||||
final name = allContacts
|
||||
.where((c) => c.publicKey.first == repeater.pubkeyFirstByte)
|
||||
.map((c) => c.name)
|
||||
.firstOrNull;
|
||||
|
||||
final selfLat = widget.connector.selfLatitude;
|
||||
final selfLon = widget.connector.selfLongitude;
|
||||
|
||||
LatLng? selfPoint;
|
||||
if (selfLat != null && selfLon != null) {
|
||||
selfPoint = LatLng(selfLat, selfLon);
|
||||
}
|
||||
|
||||
final contact = getRepeaterPrefixMatchNearLocation(
|
||||
allContacts,
|
||||
repeater.pubkeyFirstByte,
|
||||
searchPoint: selfPoint,
|
||||
preferFavorites: true,
|
||||
);
|
||||
|
||||
final name = contact?.name;
|
||||
|
||||
return Column(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user