charonErrorState property

Future<CharonErrorState?> charonErrorState

Get current error state from VpnStateService. (Android only) When FlutterVpnState.genericError is received, details of error can be inspected by CharonErrorState. Returns null on non-android platform.

Implementation

static Future<CharonErrorState?> get charonErrorState async {
  if (!Platform.isAndroid) return null;
  var state = await _channel.invokeMethod<int>('getCharonErrorState');
  assert(
    state != null,
    'Received a null state from `getCharonErrorState` call.',
  );
  return CharonErrorState.values[state!];
}