flutter_vpn 0.5.0

Flutter VPN plugin #

Pub Package Awesome Flutter

This plugin help developers to access VPN service in their flutter app.
本插件帮助开发者在自己的应用内调用 VPN 服务。

The Android part was implemented by strongswan which support ikev2 protocol.
The iOS part was implemented by NEVPNManager.

Issues and PRs are welcome!

Installation #

For Android #

Modify your app/build.gradle to use abiFilter because flutter doesn't apply abiFilter for target platform yet.

android {
    ...
    buildTypes {
        ...
        release {
            ...
            ndk {
                    if (project.hasProperty('target-platform')) {
                        if (project.property('target-platform') == 'android-arm,android-arm64')
                            abiFilters 'armeabi-v7a', 'arm64-v8a'
                        else if (project.property('target-platform') == 'android-arm')
                            abiFilters 'armeabi-v7a'
                        else if (project.property('target-platform') == 'android-arm64')
                            abiFilters 'arm64-v8a'
                    }
                }
            }
    }
}

The plugin will automatically download pre-build native libraries from here if they haven't been downloaded.

For iOS #

You need to open Personal VPN and Network Extensions capabilities in Xcode: see Project->Capabilities.

VPN connection errors are handled in swift code, you need to use Xcode to see connection errors if there is any.

0.5.0 #

Fix (#15) event handler for android (Flutter 1.6+).

0.4.0 #

Fix state error if disconnect while connecting. Add iOS state handler.

0.3.0 #

Add getVpnState for iOS.

0.2.0 #

Add getVpnState and getCharonState for Android. Breaking Change
Old FlutterVpnState has been renamed to CharonVpnState. This method is for Android only.
New FlutterVpnState is designed for both Android and iOS platform.

0.1.0 #

Support arm64-v8a for android

We have added the libraries for arm64-v8a. Please follow README to configure abiFilter for NDK.

Migrate to AndroidX #

Breaking Change
Migrate from the deprecated original Android Support Library to AndroidX. This shouldn't result in any functional changes, but it requires any Android apps using this plugin to also migrate if they're using the original support library. Follow Official documents to migrate.

0.0.4 #

Add iOS support without status broadcast.

0.0.3 #

Add onStateChanged to receive state changes from charon.

0.0.2 #

(Deprecated) Implemented simplest IkeV2-eap VPN service. Automatically download native libs before building.

example/README.md

flutter_vpn_example #

Demonstrates how to use the flutter_vpn plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_vpn: ^0.5.0

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_vpn/flutter_vpn.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
62
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
81
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test

Admin