diff --git a/lib/screens/contacts_tab.dart b/lib/screens/contacts_tab.dart index b8127af..90c9dac 100644 --- a/lib/screens/contacts_tab.dart +++ b/lib/screens/contacts_tab.dart @@ -710,12 +710,34 @@ class _ContactTile extends StatelessWidget { const SizedBox(height: 16), ], if (contact.telemetry != null) ...[ - const Text( - 'Telemetry:', - style: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 16, - ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + const Text( + 'Telemetry:', + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + TextButton.icon( + onPressed: () { + final connectionProvider = context.read(); + 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), if (contact.telemetry!.batteryMilliVolts != null)