https://github.com/lemos1235/flutter_leaf
A new flutter vpn plugin based on leaf
https://github.com/lemos1235/flutter_leaf
flutter leaf vpn
Last synced: 5 months ago
JSON representation
A new flutter vpn plugin based on leaf
- Host: GitHub
- URL: https://github.com/lemos1235/flutter_leaf
- Owner: lemos1235
- License: other
- Created: 2023-08-13T08:16:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-03T13:36:17.000Z (about 1 year ago)
- Last Synced: 2025-05-03T14:34:18.703Z (about 1 year ago)
- Topics: flutter, leaf, vpn
- Language: C++
- Homepage:
- Size: 11.2 MB
- Stars: 0
- Watchers: 0
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Leaf
A Flutter VPN plugin based on [Leaf](https://github.com/eycorsican/leaf).
## Installation
```yaml
dependencies:
flutter_leaf: ^0.0.1
```
## Usage
```dart
import 'package:flutter_leaf/flutter_leaf.dart';
// Check VPN permission (only required for Android)
bool prepared = await FlutterLeaf.prepared;
if (!prepared) {
prepared = await FlutterLeaf.prepare();
}
// Connect to VPN
await FlutterLeaf.connect(
configContent: yourConfigContent,
);
// Listen for state changes
FlutterLeaf.onStateChanged.listen((state) {
print('VPN state: $state');
});
// Disconnect
await FlutterLeaf.disconnect();
```
## License
This project is open-sourced under the MIT License.