charonErrorState property

  1. @override
Future<CharonErrorState?> get charonErrorState
override

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

Implementation

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