https://github.com/odd-io/flutter_signal_strength
A Flutter plugin to get cellular and WiFi signal strength information
https://github.com/odd-io/flutter_signal_strength
cellular flutter
Last synced: about 1 month ago
JSON representation
A Flutter plugin to get cellular and WiFi signal strength information
- Host: GitHub
- URL: https://github.com/odd-io/flutter_signal_strength
- Owner: odd-io
- License: mit
- Created: 2025-01-23T10:24:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-23T11:18:58.000Z (over 1 year ago)
- Last Synced: 2025-01-23T11:37:13.067Z (over 1 year ago)
- Topics: cellular, flutter
- Language: Dart
- Homepage: https://pub.dev/packages/flutter_signal_strength
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter Signal Strength
A Flutter plugin to get cellular and WiFi signal strength information for Android devices. The plugin provides both normalized signal levels (0-4) and raw dBm values.
## Features
- Get cellular signal strength (level 0-4 and dBm)
- Get WiFi signal strength (level 0-4 and dBm)
- Detailed error handling for permission and availability issues
## Getting Started
### Installation
Add this to your package's `pubspec.yaml` file:
```yaml
dependencies:
flutter_signal_strength: ^0.0.1
```
### Required Permissions
Add these permissions to your Android app's `AndroidManifest.xml`:
```xml
```
### Usage
First, ensure you have the required permissions. You can use any permission handling package (like `permission_handler`) to request permissions:
```dart
// Request permissions before using the plugin
// Example using permission_handler package:
await Permission.phone.request();
await Permission.location.request();
```
Then use the plugin:
```dart
final signalStrength = FlutterSignalStrength();
// Get cellular signal level (0-4)
try {
final level = await signalStrength.getCellularSignalStrength();
print('Cellular signal level: $level');
} on PlatformException catch (e) {
print('Failed to get cellular signal: ${e.message}');
}
// Get cellular signal in dBm
try {
final dbm = await signalStrength.getCellularSignalStrengthDbm();
print('Cellular signal strength: $dbm dBm');
} on PlatformException catch (e) {
print('Failed to get cellular signal: ${e.message}');
}
// Get WiFi signal level (0-4)
try {
final level = await signalStrength.getWifiSignalStrength();
print('WiFi signal level: $level');
} on PlatformException catch (e) {
print('Failed to get WiFi signal: ${e.message}');
}
// Get WiFi signal in dBm
try {
final dbm = await signalStrength.getWifiSignalStrengthDbm();
print('WiFi signal strength: $dbm dBm');
} on PlatformException catch (e) {
print('Failed to get WiFi signal: ${e.message}');
}
```
## Error Handling
The plugin throws `PlatformException` in the following cases:
- Required permissions are not granted
- Device services (cellular/WiFi) are not available
- Signal strength information cannot be retrieved
## Example
Check out the [example](example) directory for a complete sample app demonstrating all features.
## Platform Support
| Android | iOS | MacOS | Web | Linux | Windows |
|---------|-----|-------|-----|--------|----------|
| ✅ | ❌ | ❌ | ❌ | ❌ | ❌ |
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
---
Made with ❤️ by odd.io