How can I implement .ovpn file via flutter_openvpn package in flutter

Viewed 1427

I wanna create a VPN application with flutter and I'm gonna do it with the .ovpn file.

I found this cool package on pub.dev but I can't understand neither the documentation nor the sample code. I imported the .ovpn file in my assets and now I'm clueless about what should I do.

I would be happy to receive help from senior developers here.

Thanks

1 Answers

You should put the assets/vpnconfig.ovp into assets folder and then read the using the file content using rootBundle.loadString

var contennt=await rootBundle.loadString('assets/vpnconfig.ovpn');
await FlutterOpenvpn.lunchVpn(
  contennt,
      ....
  
);
Related