mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-12 00:40:28 +00:00
feat: Add refresh button for telemetry requests in contact details
This commit is contained in:
@@ -710,12 +710,34 @@ class _ContactTile extends StatelessWidget {
|
|||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
],
|
],
|
||||||
if (contact.telemetry != null) ...[
|
if (contact.telemetry != null) ...[
|
||||||
const Text(
|
Row(
|
||||||
'Telemetry:',
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
style: TextStyle(
|
children: [
|
||||||
fontWeight: FontWeight.bold,
|
const Text(
|
||||||
fontSize: 16,
|
'Telemetry:',
|
||||||
),
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 16,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton.icon(
|
||||||
|
onPressed: () {
|
||||||
|
final connectionProvider = context.read<ConnectionProvider>();
|
||||||
|
connectionProvider.requestTelemetry(contact.publicKey, zeroHop: true);
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
|
SnackBar(
|
||||||
|
content: Text('Requesting telemetry from ${contact.displayName}...'),
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.refresh, size: 18),
|
||||||
|
label: const Text('Refresh'),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
if (contact.telemetry!.batteryMilliVolts != null)
|
if (contact.telemetry!.batteryMilliVolts != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user