getNetworkHealth method
Raw network metrics map. options is DiagnosticsOptions.toChannelArgs.
Implementation
@override
Future<Map<String, dynamic>> getNetworkHealth(
Map<String, dynamic> options,
) async {
final online = web.window.navigator.onLine;
bool? reachable;
if (options['include_network_reachability'] == true) {
reachable = online;
}
return <String, dynamic>{
'connection_types': <String>[online ? 'other' : 'none'],
'has_connectivity': online,
'is_internet_reachable': reachable,
'is_metered': false,
};
}