-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(bug): fix bug where footer not attached to keyboard in some device and update flutter_keyboard_visibility
#35
base: master
Are you sure you want to change the base?
Conversation
update _bottomInset and _animationBegin using didChangeMetrics method
use value notifier to update dynamic data of bottom inset and animation begin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class encapsulates bottomInset
and animationBegin
, allowing these properties to be bundled together. By encapsulating them within this class, we facilitate their use in a ValueNotifier
, promoting a cleaner and more efficient way to manage and react to changes in these values.
Example:
ValueNotifier<KeyboardAnimationData> _keyboardAnimationDataNotifier = ValueNotifier(const KeyboardAnimationData());
This approach simplifies the tracking of keyboard animation data changes, enabling more responsive and straightforward UI updates.
Please kindly review @drogel |
@drogel Can you check it please? |
Hello @drogel - would appreciate a review, merge and release of this (thanks @ryanaidilp for the change). Our app is stuck on some other dependencies because of this version. |
PR Description
This PR introduces several enhancements and bug fixes to the
keyboard_attachable
package, significantly improving its reliability and functionality across different devices and scenarios. Here are the key changes:Enhancements:
analysis_options.yaml
to streamline code analysis and ensure consistency with Flutter's recommended linter rules.flutter_keyboard_visibility
package from version5.4.1
to6.0.0
. This update embraces the latest improvements and fixes fromflutter_keyboard_visibility
, ensuring better keyboard visibility handling. (Should resolve Update flutter_keyboard_visibility to 6.0.0 #34)Bug Fixes:
KeyboardAttachable
, sometimes did not attach correctly above the keyboard. This problem was due to incorrect keyboard height calculations on some devices, whereMediaQuery.of(context).viewInsets.bottom
returned0
. The fix involves usingMediaQueryData.fromWindow(WidgetsBinding.instance.window)
to obtain more accurate keyboard height measurements.bottomInset
andanimationBegin
within a newKeyboardAnimationData
class. This encapsulation promotes better data management and streamlines animation handling.WidgetBindingObserver
mixin and utilizeddidChangeMetrics
to listen to changes in the app's metrics. This approach ensures that the_updateBottomSizeIfNeeded
logic is executed promptly, adjusting the UI in response to any metrics changes, including keyboard appearance.ValueNotifier
withKeyboardAnimationData
instead of relying solely on local variables. This change guarantees that the UI is rebuilt when there are changes to the keyboard's visibility or size, addressing issues where the UI did not update on some devices.These improvements aim to make
keyboard_attachable
more robust and versatile, providing a better developer experience and ensuring more consistent behavior across various devices.