[screen_state] iOS support and renewal of the native example apps #901
+741
−592
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I introduced iOS support to the 'screen_state' package by leveraging the 'isProtectedDataAvailable' and 'brightness' parameters for screen state analysis. Additionally, I refined the base plugin to facilitate its utilization in iOS applications, and optimized code readability and data handling with enhanced enums.
Moreover, I updated the native example apps using Flutter 3.16.9 as the foundation, addressing their outdated status and ensuring compatibility with iOS.
Despite these advancements, I encountered limitations inherent to the iOS platform. Notably, the 'isProtectedDataAvailable' parameter only provides data if the user has any form of password protection enabled, rendering it ineffective for detecting unlocks on devices without a password. Furthermore, the iOS simulator's inability to replicate device locking behavior and its distinct brightness controls hampered event detection within the simulator environment.
Throughout development, I conducted testing on an iPhone 6+ running iOS 12.5.7, successfully capturing all relevant events.