check_vpn_connection 0.0.1 copy "check_vpn_connection: ^0.0.1" to clipboard
check_vpn_connection: ^0.0.1 copied to clipboard

outdated

A simple and lightweight Flutter package that lets you define VPN connection status on your devices.

example/lib/main.dart

import 'package:check_vpn_connection/check_vpn_connection.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Check VPN connection"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'VPN is active:',
            ),
            FutureBuilder(
                future: CheckVpnConnection.isVpnActive(),
                builder: (context, AsyncSnapshot<bool> snapshot) {
                  if (snapshot.hasData) {
                    return Text(
                      snapshot.data.toString(),
                      style: Theme.of(context).textTheme.headline4,
                    );
                  } else
                    return CircularProgressIndicator();
                }),
          ],
        ),
      ),
    );
  }
}
38
likes
40
pub points
91%
popularity

Publisher

unverified uploader

A simple and lightweight Flutter package that lets you define VPN connection status on your devices.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on check_vpn_connection