Repository navigation
fix: keep the iOS View floating action button off the navigation bar - #68
Merged
AdamMusa merged 2 commits intoNov 2, 2026
Merged
Conversation
The persistent View bottom_sheet was aligned to the bottom of the whole Cupertino scaffold content, which includes the bottom navigation bar, so it covered the tab bar. Like Material's Scaffold.bottomSheet it now floats over the body inside the region above the navigation bar; the scaffold SafeArea still keeps it above the home indicator when there is no bar.
The Cupertino scaffold aligned the floating action button over the whole content, including the bottom navigation bar, so every bottom location covered the tab bar (and the persistent bottom sheet). The region above the bar is now laid out like Material's Scaffold: the FAB keeps the 16 px kFloatingActionButtonMargin above the bar, or rests centred on the bottom sheet's top edge (FabFloatOffsetY). Docked locations float, as CupertinoTabBar has no notch.
This was referenced Oct 29, 2026
This was referenced Nov 6, 2026
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.
Depends on #66 (
fix/cupertino-view-bottom-sheet-tab-bar). This branch is stacked on it because it replaces the body-region layout that #66 introduced. Until #66 merges, the diff also shows its commit658f1c4; review commit166bad8.Engine-only fix with no Ruby change. QA asked us to check the suspicion raised in #66.
Bug (confirmed by a geometry test before any fix)
On iOS/macOS,
RufletCupertinoPageScaffoldaligned the View'sfloating_action_buttonover the whole scaffold content, which includes the bottomnavigation_bar. The FAB's only spacing wasSafeArea(minimum: 16)from the screen edge.Measured on #66 (800x600, 54/34 px insets,
endFloat): FAB at y 494–550 and tab bar at 516–566, so the FAB covered 34 px of the tab bar. It also ignored the persistentbottom_sheet: the FAB sat over its lower part (sheet 452–516).This affected all 7 bottom spellings (default,
start/center/endFloat,start/center/endDocked). Top locations and the no-nav-bar case were already correct.Fix
lib/src/widgets/cupertino_page_scaffold.dart: the region above the bottom navigation bar is now laid out by a smallMultiChildLayoutDelegate(_CupertinoBodyLayout) that follows Material'sScaffold:kFloatingActionButtonMargin) from the region's edges, so on bottom locations it sits 16 px above the barmin(that, sheetTop - fabHeight/2), which is Flutter'sFabFloatOffsetY: like Material, the FAB moves up and rests centred on the sheet's top edgeLayoutIdkeys keep the body's state when the sheet or FAB appear or disappear; the drawer overlay stays above everythingIntentional deviation: iOS has no notched tab bar, so
*Dockedlocations are laid out like*Float(above the bar, never over it). On Material, docked FABs keep straddling the bottom bar, as before.Tests
New
test/widgets/view_floating_action_button_geometry_test.dartrenders a real Ruby-shaped View (navigation_bar+floating_action_button[+bottom_sheet]) throughPlatformApp:fab.bottom == nav.top - 16; top locations havefab.top == 54 + 16; horizontal margin is 16 or centred; no Material widgetsfab.top == min(nav.top - 16 - h, sheet.top - h/2)(at most the upper half rests on the sheet); top locations do not touch the sheetScaffold, with and without the sheet, and in the safe area. This is the oracle the iOS assertions follow.view_bottom_sheet_geometry_test(#66),platform_page_scaffold_test,canonical_page_chrome_test,ruby_fab_colors_testverify_pr.sh(Flutter 3.41.2; Ruby tree = cleanorigin/mainb34072be because Ruby is unchanged):Ruby usage (unchanged API)