EN | RU
connectivity_plus_aurora
Original Readme.
Description
The Aurora implementation of connectivity_plus.
A Flutter plugin to check connectivity status and listen to connectivity changes on Aurora OS devices. This plugin provides comprehensive network connection monitoring capabilities, allowing applications to adapt their behavior based on available network types. Essential for mobile applications that need to optimize data usage, provide offline functionality, or switch between different network types.
Quickstart: Basic Usage Example
import 'package:connectivity_plus/connectivity_plus.dart';
// Check current connectivity status
final connectivityResult = await (Connectivity().checkConnectivity());
if (connectivityResult == ConnectivityResult.mobile) {
// Connected to mobile network
print('Mobile network connection');
} else if (connectivityResult == ConnectivityResult.wifi) {
// Connected to WiFi network
print('WiFi network connection');
} else if (connectivityResult == ConnectivityResult.ethernet) {
// Connected to wired network
print('Ethernet network connection');
} else if (connectivityResult == ConnectivityResult.vpn) {
// Note: VPN is not yet supported on Aurora OS
print('VPN connection (not supported on Aurora OS yet)');
} else if (connectivityResult == ConnectivityResult.none) {
// No network connection
print('No network connection available');
}
// Listen for connectivity changes
Connectivity().onConnectivityChanged.listen((List<ConnectivityResult> results) {
print('Connectivity changed: $results');
});
Features
- Multiple Network Types - Detect WiFi, mobile, ethernet, Bluetooth, and VPN connections
- Real-time Monitoring - Stream-based connectivity status updates
- Easy Integration - Simple API with minimal setup required
Contents
Installation and build
pubspec.yaml
dependencies:
connectivity_plus: ^6.1.0
connectivity_plus_aurora:
git:
url: https://developer.auroraos.ru/git/flutter/flutter-community-plugins/connectivity_plus_aurora.git
To use the plugin, you need to enable Qt support in aurora/main.cpp:
#include <flutter/flutter_compatibility_qt.h> // Add for Qt
#include "generated_plugin_registrant.h"
int main(int argc, char *argv[]) {
aurora::FlutterApp app(argc, argv);
aurora::EnableQtCompatibility();
return app.exec();
}
Compatibility
The plugin has been working correctly since the 5.0.0 version of the Aurora OS.
Terms of Use and Participation
The source code of the project is provided under the license, that allows it to be used in third-party applications.
To participate in the development of the project, please read the contributor agreement. If you plan to contribute your own source code to the project, you will need to accept the CLA agreement.
For information about contributors see AUTHORS.
Code of conduct is a current set of rules of the Open Mobile Platform which informs you how we expect the members of the community will interact while contributing and communicating.