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
void didChangeMetrics() {
super.didChangeMetrics();
SchedulerBinding.instance!.addPostFrameCallback((_) {
hideOverlay();
syncWidgetAndOverlay();
});
final newInsets = MediaQuery.of(context).viewPadding;
if (newInsets.bottom != _previousInsets?.bottom) {
WidgetsBinding.instance!.addPostFrameCallback((_) {
hideOverlay();
syncWidgetAndOverlay();
});
_previousInsets = newInsets;
}
}
@override
@@ -470,7 +470,7 @@ class MessageInputState extends State<MessageInput> {
overlayOptions: [
OverlayOption(
overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy),
position: offset,
child: _buildMentionsOverlayEntry(),
),
showOverlay: _showMentionsOverlay,
@@ -478,7 +478,7 @@ class MessageInputState extends State<MessageInput> {
OverlayOption(
showOverlay: _showCommandsOverlay,
overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy),
position: offset,
child: _buildCommandsOverlayEntry(),
),
),
@@ -493,10 +493,11 @@ class MessageInputState extends State<MessageInput> {
)
.contains(':'),
overlayBuilder: (context, offset) => CenterAbout(
position: Offset(offset.dx, offset.dy),
position: offset,
child: _buildEmojiOverlay(),
),
),
...widget.customOverlays,
],
child: child,
);