system_state 1.4.1
system_state: ^1.4.1 copied to clipboard
A Flutter plugin for monitoring and controlling system states like battery, Wi-Fi, volume, and mobile data on Android.
Changelog #
All notable changes to this project will be documented in this file.
1.4.1 #
Fixed #
- Documentation Update: Explicitly listed the required iOS
Info.plistprivacy keys (NSLocationWhenInUseUsageDescriptionandNSBluetoothAlwaysUsageDescription) in the README to ensure developers do not face rejection during Apple App Store review.
1.4.0 #
Added #
- Native iOS Support 🍎: The plugin now officially supports iOS! It uses native Apple frameworks (
AVAudioSession,UIDevice,NWPathMonitor,CTTelephonyNetworkInfo, andCBCentralManager) to monitor the device's system states.- Note: Due to Apple's strict privacy restrictions, programmatically toggling Wi-Fi, Mobile Data, and Bluetooth is restricted to a no-op on iOS, but reading and real-time monitoring works perfectly. Check the
README.mdfor full capability mappings.
- Note: Due to Apple's strict privacy restrictions, programmatically toggling Wi-Fi, Mobile Data, and Bluetooth is restricted to a no-op on iOS, but reading and real-time monitoring works perfectly. Check the
1.3.2 #
Added #
- Unit Tests: Added a comprehensive test suite in
test/system_state_test.dartthat dynamically mocks thesystem_state/methodsplatform channel. Verifies all 5 controllers. - Cross-Platform Readiness: Removed the explicit
Platform.isAndroidexceptions from Dart controllers, fixing CI/CD test execution issues and unblocking future iOS/Web implementations.
1.3.1 #
Fixed #
- Memory Leak: Fixed severe memory leak in Android
SystemStatePluginduring detach. - Documentation Alignment:
- Renamed
BatteryState.leveltobatteryLevelandBatteryController.getBatterytogetBatteryStateto exactly match README. - Added missing
simOperatorfield toMobileDataState. - Added native support for separating
pairedDevicesandconnectedDevicesinBluetoothState.
- Renamed
- Deprecated APIs: Migrated from deprecated
CONNECTIVITY_ACTIONbroadcast receiver to modernConnectivityManager.NetworkCallback. - Error Handling: Added try-catch blocks to all platform channel invocations in
BluetoothControllerfor consistency. - Example App: Enhanced the example to demonstrate
MobileDatamonitoring and real-time EventChannel listeners.
1.3.0 #
Added #
- Bluetooth Controller: New module for managing and controlling Bluetooth.
- Check and toggle Bluetooth state (On/Off).
- Retrieve paired and connected devices (Name, MAC, State).
- Listeners for state and connection changes.
1.2.7 #
Upgraded #
- Upgraded Flutter & Code Optimization:
- Upgraded the plugin to the latest stable Flutter version.
- Optimized code for better performance and maintainability.
- Improved modular structure and internal documentation for easier usage.
1.2.6 #
Added #
- Mobile Data Controller:
- Functionality to check if mobile data is enabled.
- Retrieve the name of the network operator (e.g., Airtel, Jio).
- Retrieve the network type (e.g., 4G, 5G).
- Listen for changes in mobile data state.
1.2.4 #
Added #
- Wi-Fi Controller: Added functionality to get Wi-Fi state, toggle Wi-Fi on/off, and listen to Wi-Fi state changes.
1.2.3 #
Added #
- Volume Controller: Added functionality to get current volume level, adjust volume, and listen to volume level changes.
1.2.2 #
Added #
- Battery Controller: Added functionality to retrieve battery level, temperature, charging status, and listen to battery state changes.
1.2.1 #
Initial Release #
- Initial release of
SystemStateplugin with modular controllers for managing and accessing device information.
Future Development #
Planned Features #
-
Network Controller: Plan to implement features to view and toggle:
- Airplane Mode: Check and update the status of airplane mode.
- Bluetooth: View and control Bluetooth status.
-
Cross-Platform Development: Expand functionality to support iOS, Web, and other platforms, enabling similar device state and control capabilities across devices.