getConnectionMode method
Directly queries the network hardware interfaces and returns the active ConnectionMode.
Implementation
Future<ConnectionMode> getConnectionMode() async {
try {
final results = await _connectivity.checkConnectivity();
final resolution = resolveModes(results);
_currentMode = resolution.primary;
_activeModes = resolution.active;
return _currentMode;
} catch (_) {
return _currentMode;
}
}