Add resizeToAvoidBottomInset Option to WoltModalSheet to Control Keyboard Overlay Behavior #163
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.
Description
This PR introduces a new flag,
resizeToAvoidBottomInset
, to theWoltModalSheetPage
. This enhancement addresses an issue (#154). With this change, developers can now choose whether theWoltModalSheet.mainContent
should resize when the onscreen keyboard appears, preventing it from shifting up and down.Solution
To address this problem, we have added the
resizeToAvoidBottomInset
flag to the WoltModalSheetPage. This flag allows developers to specify whether the main content of the modal sheet should be resized to avoid being obscured by the keyboard. Internally, WoltModalSheet uses a Scaffold widget to implement this functionality. The flag's default value is sourced from [WoltModalSheetDefaultThemeData.resizeToAvoidBottomInset], and set to true so that existing package users are not affected.Usage
To prevent the wolt_modal_sheet from shifting when the keyboard appears, set resizeToAvoidBottomInset to false in the WoltModalSheetPage. This will cause the keyboard to overlay directly on top of the modal sheet, without affecting its position or triggering a page reconstruction.
resize_false.mp4
resize_true.mp4
Related Issues
#154
Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?