Repository navigation
Add getBarRegion: where a bar fits beside the status icons - #5
Merged
Merged
Conversation
WindowPlacementDetector.getBarRegion(edge, extent) wraps UIKit's UIView.LayoutRegion.bar(onEdge:extent:) (iOS 27.1): the region for a bar of that thickness along a window edge, in Flutter's coordinates, clear of the status icons, the rounded corners and the home indicator. On the iPhone Duo the status icons sit in a column at the side (or a band at the top in unfolded portrait), and the safe area gives up that whole column or band. A bar region on that edge starts below the icons; a top bar region ends before them. Null before iOS 27.1, on Android and without a window. The platform interface defaults to null, so other implementations keep working. Bumps the version to 0.0.3.
Xcode 26 (iOS 26 SDK) doesn't know UIView.LayoutRegion.bar(onEdge:extent:), so the plugin failed to compile there: #available only guards the call at run time. Look up layoutRegionForBarOnEdge:extent: and layoutGuideForLayoutRegion: at run time instead, and return nil where they are missing. Same regions as the direct call on the iOS 27.1 simulator.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
WindowPlacementDetector.getBarRegion(WindowEdge edge, double extent)returns where the system places a bar of that thickness along a window edge, as aRectin Flutter's coordinates, clear of the status icons, the rounded corners and the home indicator. It wraps UIKit'sUIView.LayoutRegion.bar(onEdge:extent:)(iOS 27.1).Why
On the iPhone Duo the status icons sit in a column at the side, or in a band at the top in unfolded portrait. The safe area gives up that whole column or band; there is no public API for the icons' frames, and
statusBarFrameis a 2 pt strip there. The bar region is the only API that knows where the icons end: a bar on their edge starts below them, a top bar ends before them.Measured on the iPhone Duo simulator (iOS 27.1), 64 pt bars:
How
getBarRegion(BarEdge, double) -> BarRegion?(regenerated with Pigeon 27.3.0, as before).implementsit need the method.WindowEdgeenum, README section, CHANGELOG, version 0.0.3.Testing
duo_navigation uses this to keep its side column and title bar clear of the status icons (separate PR, needs this released as 0.0.3).