Skip to content

Flutter plugin to get VPN status on Android and iOS platforms

License

Notifications You must be signed in to change notification settings

cr0manty/vpn_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vpn_check

Get vpn active status for Android, iOS and MacOS

Getting Started

A simple usage example:

import 'package:vpn_check/vpn_check.dart';

final vpnChecker = VPNChecker();
bool isVpnActive = false;

try {
    isVpnActive = await vpnChecker.isVPNEnabled();
} on VPNUnhandledException catch (e) {
    print(e);
}

vpnChecker.vpnActiveStream.listen((isActive) {
  isVpnActive = isActive;
  print('is vpn active: $isActive');
},
  cancelOnError: false,
);

// You can also use widget builder
  ...
  VPNStatusBuilder(
    builder: (BuildContext context, VPNStatus value) {
      return Center(
        child: Text('VPN status: ${value.name}'),
      );
    },
  ),
  ...

Support Platform

  • Android
  • iOS
  • MacOS

Plans

  • Linux
  • Windows

About

Flutter plugin to get VPN status on Android and iOS platforms

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published