浏览代码

add viewInsets listener

lucky1213 4 年前
父节点
当前提交
8c973e09e2
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8
    0
      packages/zefyr/lib/src/widgets/editor.dart

+ 8
- 0
packages/zefyr/lib/src/widgets/editor.dart 查看文件

@@ -142,6 +142,14 @@ class _ZefyrEditorState extends State<ZefyrEditor> {
142 142
     super.initState();
143 143
     _imageDelegate = widget.imageDelegate;
144 144
     _linkDelegate = widget.linkDelegate;
145
+    WidgetsBinding.instance.addPostFrameCallback((Duration duration) {
146
+      if (MediaQuery.of(context).viewInsets.bottom == 0) {
147
+        if (!_scope.keepOverlay) {
148
+          _scope.toolbarAction = null;
149
+          hideToolbar();
150
+        }
151
+      }
152
+    });
145 153
   }
146 154
 
147 155
   @override