MethodChannelFlutterVpn class

An implementation of IkeV2Platform that uses method channels.

Inheritance

Constructors

MethodChannelFlutterVpn()

Properties

charonErrorState Future<CharonErrorState?>
Get current error state from VpnStateService. (Android only) When IkeV2State.error is received, details of error can be inspected by CharonErrorState. Returns null on non-android platform.
no setteroverride
currentState Future<IkeV2State>
Get current state.
no setteroverride
eventChannel EventChannel
The method channel used to receive state change event.
final
hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
onStateChanged Stream<IkeV2State>
Receive state change from VPN service.
no setteroverride
onTrafficChanged Stream<VpnTrafficStats>
Get traffic stats (Android only).
no setteroverride
prepared Future<bool>
Check if vpn connection has been prepared. (Android only)
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trafficChannel EventChannel
final

Methods

connectIkev2EAP({required String server, required String username, required String password, String? name, int? mtu, int? port, String? remoteId, String? localId, bool disableCertValidation = false}) Future<void>
Connect to VPN. (IKEv2-EAP)
override
connectIkev2Psk({required String server, required String username, required String password, required String remoteId, required String localId, String? name, int? mtu, int? port}) Future<void>
Connect to VPN. (IKEv2-PSK)
override
connectIPSec({required String server, required String username, required String password, required String secret, String? name, int? mtu, int? port}) Future<void>
Connect to VPN. (IPSec)
override
disconnect() Future<void>
Disconnect and stop VPN service.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepare() Future<bool>
Prepare for vpn connection. (Android only)
override
startTrafficMonitor() Future<void>
Start traffic monitoring manually (e.g. on app restart).
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited