Procházet zdrojové kódy

add viewInsets listener

lucky1213 před 4 roky
rodič
revize
8c973e09e2
1 změnil soubory, kde provedl 8 přidání a 0 odebrání
  1. 8
    0
      packages/zefyr/lib/src/widgets/editor.dart

+ 8
- 0
packages/zefyr/lib/src/widgets/editor.dart Zobrazit soubor

@@ -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