WireGuardFlutter class

The main class for interacting with the WireGuard VPN plugin.

This class provides methods to initialize, start, stop, and monitor the WireGuard VPN tunnel.

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trafficSnapshot Stream<Map<String, dynamic>>
Stream of traffic statistics.
no setteroverride
vpnStageSnapshot Stream<VpnStage>
Stream of VPN stage changes.
no setteroverride

Methods

checkVpnPermission() Future<bool>
Checks if the VPN permission is granted.
override
initialize({required String interfaceName, String? vpnName, String? iosAppGroup}) Future<void>
Initializes the WireGuard VPN tunnel.
override
isConnected() Future<bool>
Checks if the VPN is currently connected.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshStage() Future<void>
Refreshes the current VPN stage.
override
stage() Future<VpnStage>
Returns the current VPN stage.
override
startVpn({required String serverAddress, required String wgQuickConfig, required String providerBundleIdentifier}) Future<void>
Starts the VPN tunnel.
override
stopVpn() Future<void>
Stops the VPN tunnel.
override
toString() String
A string representation of this object.
inherited
trafficStats() Future<Map<String, dynamic>>
Returns the current traffic statistics.
override

Operators

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

Static Properties

instance WireGuardFlutterInterface
Returns the singleton instance of WireGuardFlutter.
no setter

Static Methods

registerWith() → void
Registers the platform-specific implementation.