collect method
Override this instead of getData to implement the actual data collection.
Implementation
@override
Future<Map<String, dynamic>> collect() async {
final interfaces = await _interfaces();
// Only attempt Wi‑Fi details if Wi‑Fi is among the active interfaces.
final hasWifi = interfaces.contains('wifi');
final wifi = hasWifi ? await _wifiDetails() : const <String, dynamic>{};
return <String, dynamic>{
'interfaces': interfaces,
if (wifi.isNotEmpty) 'wifi': wifi,
};
}