fix(ui): fix ios

This commit is contained in:
Salvatore Giordano
2021-09-20 13:35:49 +02:00
parent acffc176db
commit 829c7042cc
2 changed files with 16 additions and 7 deletions
@@ -98,14 +98,22 @@ class _OverlayBuilderState extends State<OverlayBuilder>
} }
} }
EdgeInsets? _previousInsets;
@override @override
void didChangeMetrics() { void didChangeMetrics() {
super.didChangeMetrics(); super.didChangeMetrics();
SchedulerBinding.instance!.addPostFrameCallback((_) { final newInsets = MediaQuery.of(context).viewPadding;
hideOverlay();
syncWidgetAndOverlay(); if (newInsets.bottom != _previousInsets?.bottom) {
}); WidgetsBinding.instance!.addPostFrameCallback((_) {
hideOverlay();
syncWidgetAndOverlay();
});
_previousInsets = newInsets;
}
} }
@override @override
@@ -470,7 +470,7 @@ class MessageInputState extends State<MessageInput> {
overlayOptions: [ overlayOptions: [
OverlayOption( OverlayOption(
overlayBuilder: (context, offset) => CenterAbout( overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy), position: offset,
child: _buildMentionsOverlayEntry(), child: _buildMentionsOverlayEntry(),
), ),
showOverlay: _showMentionsOverlay, showOverlay: _showMentionsOverlay,
@@ -478,7 +478,7 @@ class MessageInputState extends State<MessageInput> {
OverlayOption( OverlayOption(
showOverlay: _showCommandsOverlay, showOverlay: _showCommandsOverlay,
overlayBuilder: (context, offset) => CenterAbout( overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy), position: offset,
child: _buildCommandsOverlayEntry(), child: _buildCommandsOverlayEntry(),
), ),
), ),
@@ -493,10 +493,11 @@ class MessageInputState extends State<MessageInput> {
) )
.contains(':'), .contains(':'),
overlayBuilder: (context, offset) => CenterAbout( overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy), position: offset,
child: _buildEmojiOverlay(), child: _buildEmojiOverlay(),
), ),
), ),
...widget.customOverlays,
], ],
child: child, child: child,
); );