Browse Source

1、修复key值取值问题

bakamaka.guan 2 năm trước cách đây
mục cha
commit
0f4d32f98f
1 tập tin đã thay đổi với 4 bổ sung3 xóa
  1. 4 3
      lib/popup_layer/popup_layer.dart

+ 4 - 3
lib/popup_layer/popup_layer.dart

@@ -20,6 +20,7 @@ class _PopupLayerState extends State<PopupLayer> {
   bool _isShowSchedulePopup = false;
   bool _isNeedCloseSchedulePopup = false;
   GlobalKey moreSchedulePopupKey = GlobalKey();
+  GlobalKey schedulePopupKey = GlobalKey();
   @override
   void initState() {
     super.initState();
@@ -49,7 +50,7 @@ class _PopupLayerState extends State<PopupLayer> {
   void _onPopupSchedule(e, GlobalKey key) {
     setState(() {
       _isShowSchedulePopup = true;
-      moreSchedulePopupKey = key;
+      schedulePopupKey = key;
     });
   }
 
@@ -83,7 +84,7 @@ class _PopupLayerState extends State<PopupLayer> {
           Listener(
             behavior: HitTestBehavior.deferToChild,
             onPointerUp: (event) {
-              _isShowMoreSchedulePopup = false;
+              _isNeedCloseMoreSchedulePopup = false;
             },
             child: _buildMoreSchedulePopup(moreSchedulePopupKey),
           ),
@@ -96,7 +97,7 @@ class _PopupLayerState extends State<PopupLayer> {
               });
               popupLayerController.onCloseSchedulePopup.emit(this, false);
             },
-            child: _buildSchedulePopup(moreSchedulePopupKey),
+            child: _buildSchedulePopup(schedulePopupKey),
           )
       ],
     );