fix: remove hidden BottomAppBar SafeArea gap in sub-editors#791
Open
faizahmaddae wants to merge 3 commits intohm21:stablefrom
Open
fix: remove hidden BottomAppBar SafeArea gap in sub-editors#791faizahmaddae wants to merge 3 commits intohm21:stablefrom
faizahmaddae wants to merge 3 commits intohm21:stablefrom
Conversation
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.
Problem
When a user sets
EditorSafeArea(bottom: false)on any sub-editor config (paint, text, blur, filter, tune, crop/rotate), a hidden gap appears between the subtool toolbar row and the bottom action row (Close/Undo/Redo/Done).The gap is approximately 34px on devices with a bottom safe area (e.g. iPhone with home indicator).
Visual
Root Cause
Flutter's
BottomAppBarwidget internally wraps its content inSafeArea(bottom: true)(source: bottom_app_bar.dart line 230):When the editor's outer
SafeArea(bottom: false)is set:viewPadding.bottomfromMediaQuery(this is the issue)So the
BottomAppBar's internalSafeArea(bottom: true)still sees the fullviewPadding.bottom(~34px) and adds it as invisible padding below theSizedBox(height: 65), expanding theBottomAppBarbeyond its intended 65px height.Since
BottomAppBaris used inside aColumn(viaGroundedBottomWrapper) alongsideGroundedBottomBar, this extra padding creates a visible gap between the two bars.Fix
Wrap each sub-editor's
ScaffoldinMediaQuery.removePadding(removeBottom: ...):MediaQuery.removePadding(removeBottom: true)zeroes outviewPadding.bottomin the MediaQuery data for all descendants, soBottomAppBar's internalSafeAreahas nothing to add.Backward Compatibility
safeArea.bottomremoveBottomvaluetrue(default)!true→falseMediaQuery.removePadding(removeBottom: false)changes nothing. Zero impact on existing users.false(explicitly set)!false→trueBottomAppBar.This is a fully backward-compatible fix. Users on default settings experience zero change.
Files Changed
lib/features/paint_editor/paint_editor.dartMediaQuery.removePaddinglib/features/text_editor/text_editor.dartMediaQuery.removePaddinglib/features/blur_editor/blur_editor.dartMediaQuery.removePaddinglib/features/filter_editor/filter_editor.dartMediaQuery.removePaddinglib/features/tune_editor/tune_editor.dartMediaQuery.removePaddinglib/features/crop_rotate_editor/crop_rotate_editor.dartMediaQuery.removePaddingReproduction Steps
safeArea: EditorSafeArea(top: false, bottom: false)on any sub-editor config (e.g.paintEditor)How to Verify the Fix
safeArea: EditorSafeArea(top: false, bottom: false)on any sub-editor