소스 검색

add viewInsets listener

lucky1213 5 년 전
부모
커밋
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