Skip to content
pubscout

wireguard_flutter

0.1.3, released 3 years ago by bgtunnel.com

Flutter plugin to setup and control VPN connections via Wireguard tunnels.

$ flutter pub add wireguard_flutter
Source repository

What it does

Allows Flutter applications to initialize, start, and stop WireGuard VPN tunnels across multiple platforms. It provides streams and methods to check the current connection stage.

AI-written summary of version 0.1.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to connect your Flutter application to a WireGuard VPN server.
  • You want to monitor VPN connection state changes in real-time.

Skip it when

  • You are building a general-purpose HTTP/WebSocket networking app that does not require a VPN tunnel.

Strengths

  • Cross-platform support including Android, iOS, Windows, macOS, and Linux.
  • Provides real-time updates on VPN connection stages.

Weaknesses

  • Requires administrator privileges on Windows and sudo/root privileges on Linux to create and manipulate tunnels.
  • Platform-specific system dependencies must be configured (e.g., wireguard-tools on Linux).

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
3

Requires native configuration such as administrative permissions on Windows, installing wireguard and wireguard-tools on Linux, and configuring provider bundle identifiers on iOS.

final wireguard = WireGuardFlutter.instance;
await wireguard.initialize(interfaceName: 'wg0');
await wireguard.startVpn(
  serverAddress: 'demo.wireguard.com:51820',
  wgQuickConfig: conf,
  providerBundleIdentifier: 'com.example',
);

Alternatives

Packages that do the same job and could replace wireguard_flutter.

Works with

Packages commonly used together with wireguard_flutter: ones it builds on, ones built on it, and its own family.