Browse Source

chore: add src folder

appflowy 2 years ago
parent
commit
d1737d35fe
34 changed files with 188 additions and 184 deletions
  1. 1 1
      frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart
  2. 1 1
      frontend/app_flowy/lib/plugins/board/presentation/card/card.dart
  3. 1 1
      frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart
  4. 2 2
      frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_toolbar.dart
  5. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_cell.dart
  6. 4 7
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart
  7. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart
  8. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart
  9. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/url_cell.dart
  10. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart
  11. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart
  12. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart
  13. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart
  14. 2 3
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart
  15. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart
  16. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/builder.dart
  17. 3 5
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart
  18. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/multi_select.dart
  19. 3 3
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart
  20. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart
  21. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/single_select.dart
  22. 1 1
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart
  23. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart
  24. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart
  25. 2 2
      frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_toolbar.dart
  26. 6 6
      frontend/app_flowy/packages/appflowy_popover/example/lib/example_button.dart
  27. 1 1
      frontend/app_flowy/packages/appflowy_popover/example/lib/main.dart
  28. 5 0
      frontend/app_flowy/packages/appflowy_popover/lib/appflowy_popover.dart
  29. 0 0
      frontend/app_flowy/packages/appflowy_popover/lib/src/follower.dart
  30. 0 0
      frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart
  31. 54 0
      frontend/app_flowy/packages/appflowy_popover/lib/src/mask.dart
  32. 44 0
      frontend/app_flowy/packages/appflowy_popover/lib/src/mutex.dart
  33. 36 129
      frontend/app_flowy/packages/appflowy_popover/lib/src/popover.dart
  34. 1 1
      frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/appflowy_stype_popover.dart

+ 1 - 1
frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart

@@ -2,7 +2,7 @@ import 'package:app_flowy/plugins/board/application/card/board_select_option_cel
 import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart';
 import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_cell/extension.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';

+ 1 - 1
frontend/app_flowy/lib/plugins/board/presentation/card/card.dart

@@ -1,7 +1,7 @@
 import 'package:app_flowy/plugins/board/application/card/card_bloc.dart';
 import 'package:app_flowy/plugins/board/application/card/card_bloc.dart';
 import 'package:app_flowy/plugins/board/application/card/card_data_controller.dart';
 import 'package:app_flowy/plugins/board/application/card/card_data_controller.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/row/row_action_sheet.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/row/row_action_sheet.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';

+ 1 - 1
frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_setting.dart

@@ -4,7 +4,7 @@ import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
 import 'package:app_flowy/plugins/grid/presentation/layout/sizes.dart';
 import 'package:app_flowy/plugins/grid/presentation/layout/sizes.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_group.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_group.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_property.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/toolbar/grid_property.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';

+ 2 - 2
frontend/app_flowy/lib/plugins/board/presentation/toolbar/board_toolbar.dart

@@ -1,5 +1,5 @@
 import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -65,7 +65,7 @@ class _SettingButtonState extends State<_SettingButton> {
     return AppFlowyPopover(
     return AppFlowyPopover(
       controller: popoverController,
       controller: popoverController,
       constraints: BoxConstraints.loose(const Size(260, 400)),
       constraints: BoxConstraints.loose(const Size(260, 400)),
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       child: FlowyIconButton(
       child: FlowyIconButton(
         hoverColor: theme.hover,
         hoverColor: theme.hover,
         width: 22,
         width: 22,

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_cell.dart

@@ -4,7 +4,7 @@ import 'package:flutter/widgets.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 import '../cell_builder.dart';
 import '../cell_builder.dart';
 import 'date_editor.dart';
 import 'date_editor.dart';

+ 4 - 7
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart

@@ -1,7 +1,7 @@
 import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:app_flowy/plugins/grid/application/cell/date_cal_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/cell/date_cal_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
@@ -300,8 +300,7 @@ class _DateTypeOptionButton extends StatelessWidget {
       selector: (state) => state.dateTypeOptionPB,
       selector: (state) => state.dateTypeOptionPB,
       builder: (context, dateTypeOptionPB) {
       builder: (context, dateTypeOptionPB) {
         return AppFlowyPopover(
         return AppFlowyPopover(
-          triggerActions:
-              PopoverTriggerActionFlags.hover | PopoverTriggerActionFlags.click,
+          triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
           offset: const Offset(20, 0),
           offset: const Offset(20, 0),
           constraints: BoxConstraints.loose(const Size(140, 100)),
           constraints: BoxConstraints.loose(const Size(140, 100)),
           child: FlowyButton(
           child: FlowyButton(
@@ -342,8 +341,7 @@ class _CalDateTimeSettingState extends State<_CalDateTimeSetting> {
     List<Widget> children = [
     List<Widget> children = [
       Popover(
       Popover(
         mutex: _popoverMutex,
         mutex: _popoverMutex,
-        triggerActions:
-            PopoverTriggerActionFlags.hover | PopoverTriggerActionFlags.click,
+        triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
         offset: const Offset(20, 0),
         offset: const Offset(20, 0),
         popupBuilder: (BuildContext context) {
         popupBuilder: (BuildContext context) {
           return OverlayContainer(
           return OverlayContainer(
@@ -359,8 +357,7 @@ class _CalDateTimeSettingState extends State<_CalDateTimeSetting> {
       ),
       ),
       Popover(
       Popover(
         mutex: _popoverMutex,
         mutex: _popoverMutex,
-        triggerActions:
-            PopoverTriggerActionFlags.hover | PopoverTriggerActionFlags.click,
+        triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
         offset: const Offset(20, 0),
         offset: const Offset(20, 0),
         popupBuilder: (BuildContext context) {
         popupBuilder: (BuildContext context) {
           return OverlayContainer(
           return OverlayContainer(

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart

@@ -1,6 +1,6 @@
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart

@@ -1,7 +1,7 @@
 import 'dart:collection';
 import 'dart:collection';
 import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart';
 import 'package:app_flowy/plugins/grid/application/cell/cell_service/cell_service.dart';
 import 'package:app_flowy/plugins/grid/application/cell/select_option_editor_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/cell/select_option_editor_bloc.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/url_cell/url_cell.dart

@@ -2,7 +2,7 @@ import 'dart:async';
 import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:app_flowy/plugins/grid/application/cell/url_cell_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/cell/url_cell_bloc.dart';
 import 'package:app_flowy/workspace/presentation/home/toast.dart';
 import 'package:app_flowy/workspace/presentation/home/toast.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
@@ -220,7 +220,7 @@ class _EditURLAccessoryState extends State<_EditURLAccessory>
       constraints: BoxConstraints.loose(const Size(300, 160)),
       constraints: BoxConstraints.loose(const Size(300, 160)),
       controller: _popoverController,
       controller: _popoverController,
       direction: PopoverDirection.bottomWithLeftAligned,
       direction: PopoverDirection.bottomWithLeftAligned,
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       offset: const Offset(0, 20),
       offset: const Offset(0, 20),
       child: svgWidget("editor/edit", color: theme.iconColor),
       child: svgWidget("editor/edit", color: theme.iconColor),
       popupBuilder: (BuildContext popoverContext) {
       popupBuilder: (BuildContext popoverContext) {

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell.dart

@@ -1,6 +1,6 @@
 import 'package:app_flowy/plugins/grid/application/field/field_cell_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_cell_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_service.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_service.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -33,7 +33,7 @@ class GridFieldCell extends StatelessWidget {
           final button = AppFlowyPopover(
           final button = AppFlowyPopover(
             constraints: BoxConstraints.loose(const Size(240, 840)),
             constraints: BoxConstraints.loose(const Size(240, 840)),
             direction: PopoverDirection.bottomWithLeftAligned,
             direction: PopoverDirection.bottomWithLeftAligned,
-            triggerActions: PopoverTriggerActionFlags.click,
+            triggerActions: PopoverTriggerFlags.click,
             offset: const Offset(0, 10),
             offset: const Offset(0, 10),
             popupBuilder: (BuildContext context) {
             popupBuilder: (BuildContext context) {
               return GridFieldCellActionSheet(
               return GridFieldCellActionSheet(

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_cell_action_sheet.dart

@@ -3,7 +3,7 @@ import 'package:app_flowy/plugins/grid/presentation/widgets/header/field_editor.
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
 import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/style_widget/button.dart';
 import 'package:flowy_infra_ui/style_widget/button.dart';

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_editor.dart

@@ -1,6 +1,6 @@
 import 'package:app_flowy/plugins/grid/application/field/field_editor_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_editor_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
 import 'package:app_flowy/workspace/presentation/widgets/dialogs.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
@@ -244,7 +244,7 @@ class _DeleteFieldButton extends StatelessWidget {
 
 
   Widget _wrapPopover(Widget widget) {
   Widget _wrapPopover(Widget widget) {
     return AppFlowyPopover(
     return AppFlowyPopover(
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       constraints: BoxConstraints.loose(const Size(400, 240)),
       constraints: BoxConstraints.loose(const Size(400, 240)),
       mutex: popoverMutex,
       mutex: popoverMutex,
       direction: PopoverDirection.center,
       direction: PopoverDirection.center,

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_list.dart

@@ -1,4 +1,4 @@
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';

+ 2 - 3
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart

@@ -1,6 +1,6 @@
 import 'dart:typed_data';
 import 'dart:typed_data';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_data_controller.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_data_controller.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:dartz/dartz.dart' show Either;
 import 'package:dartz/dartz.dart' show Either;
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
@@ -66,8 +66,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
       height: GridSize.typeOptionItemHeight,
       height: GridSize.typeOptionItemHeight,
       child: AppFlowyPopover(
       child: AppFlowyPopover(
         constraints: BoxConstraints.loose(const Size(460, 440)),
         constraints: BoxConstraints.loose(const Size(460, 440)),
-        triggerActions:
-            PopoverTriggerActionFlags.click | PopoverTriggerActionFlags.hover,
+        triggerActions: PopoverTriggerFlags.click | PopoverTriggerFlags.hover,
         mutex: popoverMutex,
         mutex: popoverMutex,
         offset: const Offset(20, 0),
         offset: const Offset(20, 0),
         popupBuilder: (context) {
         popupBuilder: (context) {

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/grid_header.dart

@@ -4,7 +4,7 @@ import 'package:app_flowy/plugins/grid/application/field/type_option/type_option
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:easy_localization/easy_localization.dart';
 import 'package:easy_localization/easy_localization.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -177,7 +177,7 @@ class CreateFieldButton extends StatelessWidget {
     final theme = context.watch<AppTheme>();
     final theme = context.watch<AppTheme>();
 
 
     return AppFlowyPopover(
     return AppFlowyPopover(
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       direction: PopoverDirection.bottomWithRightAligned,
       direction: PopoverDirection.bottomWithRightAligned,
       constraints: BoxConstraints.loose(const Size(240, 200)),
       constraints: BoxConstraints.loose(const Size(240, 200)),
       child: FlowyButton(
       child: FlowyButton(

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/builder.dart

@@ -3,7 +3,7 @@ import 'dart:typed_data';
 import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
 import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_data_controller.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_data_controller.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/checkbox_type_option.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/checkbox_type_option.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/date_type_option.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/date_type_option.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/multi_select_type_option.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/multi_select_type_option.pb.dart';

+ 3 - 5
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/date.dart

@@ -11,7 +11,7 @@ import 'package:flowy_infra_ui/widget/spacing.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/date_type_option_entities.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/date_type_option_entities.pb.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import '../../../layout/sizes.dart';
 import '../../../layout/sizes.dart';
 import '../field_type_option_editor.dart';
 import '../field_type_option_editor.dart';
 import 'builder.dart';
 import 'builder.dart';
@@ -64,8 +64,7 @@ class DateTypeOptionWidget extends TypeOptionWidget {
   Widget _renderDateFormatButton(BuildContext context, DateFormat dataFormat) {
   Widget _renderDateFormatButton(BuildContext context, DateFormat dataFormat) {
     return AppFlowyPopover(
     return AppFlowyPopover(
       mutex: popoverMutex,
       mutex: popoverMutex,
-      triggerActions:
-          PopoverTriggerActionFlags.hover | PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
       offset: const Offset(20, 0),
       offset: const Offset(20, 0),
       constraints: BoxConstraints.loose(const Size(460, 440)),
       constraints: BoxConstraints.loose(const Size(460, 440)),
       popupBuilder: (popoverContext) {
       popupBuilder: (popoverContext) {
@@ -86,8 +85,7 @@ class DateTypeOptionWidget extends TypeOptionWidget {
   Widget _renderTimeFormatButton(BuildContext context, TimeFormat timeFormat) {
   Widget _renderTimeFormatButton(BuildContext context, TimeFormat timeFormat) {
     return AppFlowyPopover(
     return AppFlowyPopover(
       mutex: popoverMutex,
       mutex: popoverMutex,
-      triggerActions:
-          PopoverTriggerActionFlags.hover | PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
       offset: const Offset(20, 0),
       offset: const Offset(20, 0),
       constraints: BoxConstraints.loose(const Size(460, 440)),
       constraints: BoxConstraints.loose(const Size(460, 440)),
       popupBuilder: (BuildContext popoverContext) {
       popupBuilder: (BuildContext popoverContext) {

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/multi_select.dart

@@ -1,7 +1,7 @@
 import 'package:app_flowy/plugins/grid/application/field/type_option/multi_select_type_option.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/multi_select_type_option.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 import '../field_type_option_editor.dart';
 import '../field_type_option_editor.dart';
 import 'builder.dart';
 import 'builder.dart';

+ 3 - 3
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/number.dart

@@ -1,7 +1,7 @@
 import 'package:app_flowy/plugins/grid/application/field/type_option/number_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/number_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/number_format_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/number_format_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -57,8 +57,8 @@ class NumberTypeOptionWidget extends TypeOptionWidget {
           builder: (context, state) {
           builder: (context, state) {
             return AppFlowyPopover(
             return AppFlowyPopover(
               mutex: popoverMutex,
               mutex: popoverMutex,
-              triggerActions: PopoverTriggerActionFlags.hover |
-                  PopoverTriggerActionFlags.click,
+              triggerActions:
+                  PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
               offset: const Offset(20, 0),
               offset: const Offset(20, 0),
               constraints: BoxConstraints.loose(const Size(460, 440)),
               constraints: BoxConstraints.loose(const Size(460, 440)),
               child: FlowyButton(
               child: FlowyButton(

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart

@@ -1,5 +1,5 @@
 import 'package:app_flowy/plugins/grid/application/field/type_option/select_option_type_option_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/select_option_type_option_bloc.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/single_select.dart

@@ -2,7 +2,7 @@ import 'package:app_flowy/plugins/grid/application/field/type_option/single_sele
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:app_flowy/plugins/grid/application/field/type_option/type_option_context.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import '../field_type_option_editor.dart';
 import '../field_type_option_editor.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'builder.dart';
 import 'builder.dart';
 import 'select_option.dart';
 import 'select_option.dart';
 
 

+ 1 - 1
frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/grid_row.dart

@@ -1,7 +1,7 @@
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/prelude.dart';
 import 'package:app_flowy/plugins/grid/application/row/row_cache.dart';
 import 'package:app_flowy/plugins/grid/application/row/row_cache.dart';
 import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart';
 import 'package:app_flowy/plugins/grid/application/row/row_data_controller.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/row/row_detail.dart

@@ -15,7 +15,7 @@ import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-grid/field_entities.pb.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 import '../../layout/sizes.dart';
 import '../../layout/sizes.dart';
 import '../cell/cell_accessory.dart';
 import '../cell/cell_accessory.dart';
@@ -197,7 +197,7 @@ class _CreateFieldButtonState extends State<_CreateFieldButton> {
     return AppFlowyPopover(
     return AppFlowyPopover(
       constraints: BoxConstraints.loose(const Size(240, 200)),
       constraints: BoxConstraints.loose(const Size(240, 200)),
       controller: popoverController,
       controller: popoverController,
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       direction: PopoverDirection.topWithLeftAligned,
       direction: PopoverDirection.topWithLeftAligned,
       onClose: widget.onClosed,
       onClose: widget.onClosed,
       child: Container(
       child: Container(

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_property.dart

@@ -3,7 +3,7 @@ import 'package:app_flowy/plugins/grid/presentation/widgets/header/field_editor.
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/startup/startup.dart';
 import 'package:app_flowy/plugins/grid/application/setting/property_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/setting/property_bloc.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/header/field_type_extension.dart';
 import 'package:app_flowy/plugins/grid/presentation/widgets/header/field_type_extension.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui.dart';
@@ -118,7 +118,7 @@ class _GridPropertyCell extends StatelessWidget {
   Widget _editFieldButton(AppTheme theme, BuildContext context) {
   Widget _editFieldButton(AppTheme theme, BuildContext context) {
     return AppFlowyPopover(
     return AppFlowyPopover(
       mutex: popoverMutex,
       mutex: popoverMutex,
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       offset: const Offset(20, 0),
       offset: const Offset(20, 0),
       constraints: BoxConstraints.loose(const Size(240, 200)),
       constraints: BoxConstraints.loose(const Size(240, 200)),
       child: FlowyButton(
       child: FlowyButton(

+ 2 - 2
frontend/app_flowy/lib/plugins/grid/presentation/widgets/toolbar/grid_toolbar.dart

@@ -1,4 +1,4 @@
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:app_flowy/plugins/grid/application/setting/setting_bloc.dart';
 import 'package:app_flowy/plugins/grid/application/setting/setting_bloc.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/image.dart';
 import 'package:flowy_infra/theme.dart';
 import 'package:flowy_infra/theme.dart';
@@ -55,7 +55,7 @@ class _SettingButton extends StatelessWidget {
     final theme = context.watch<AppTheme>();
     final theme = context.watch<AppTheme>();
     return AppFlowyPopover(
     return AppFlowyPopover(
       constraints: BoxConstraints.loose(const Size(260, 400)),
       constraints: BoxConstraints.loose(const Size(260, 400)),
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       offset: const Offset(0, 10),
       offset: const Offset(0, 10),
       child: FlowyIconButton(
       child: FlowyIconButton(
         width: 22,
         width: 22,

+ 6 - 6
frontend/app_flowy/packages/appflowy_popover/example/lib/example_button.dart

@@ -1,5 +1,5 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 
 
 class PopoverMenu extends StatefulWidget {
 class PopoverMenu extends StatefulWidget {
   const PopoverMenu({Key? key}) : super(key: key);
   const PopoverMenu({Key? key}) : super(key: key);
@@ -41,8 +41,8 @@ class _PopoverMenuState extends State<PopoverMenu> {
                       decoration: null)),
                       decoration: null)),
             ),
             ),
             Popover(
             Popover(
-              triggerActions: PopoverTriggerActionFlags.hover |
-                  PopoverTriggerActionFlags.click,
+              triggerActions:
+                  PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
               mutex: popOverMutex,
               mutex: popOverMutex,
               offset: const Offset(10, 0),
               offset: const Offset(10, 0),
               popupBuilder: (BuildContext context) {
               popupBuilder: (BuildContext context) {
@@ -54,8 +54,8 @@ class _PopoverMenuState extends State<PopoverMenu> {
               ),
               ),
             ),
             ),
             Popover(
             Popover(
-              triggerActions: PopoverTriggerActionFlags.hover |
-                  PopoverTriggerActionFlags.click,
+              triggerActions:
+                  PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
               mutex: popOverMutex,
               mutex: popOverMutex,
               offset: const Offset(10, 0),
               offset: const Offset(10, 0),
               popupBuilder: (BuildContext context) {
               popupBuilder: (BuildContext context) {
@@ -86,7 +86,7 @@ class ExampleButton extends StatelessWidget {
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return Popover(
     return Popover(
-      triggerActions: PopoverTriggerActionFlags.click,
+      triggerActions: PopoverTriggerFlags.click,
       offset: offset,
       offset: offset,
       direction: direction ?? PopoverDirection.rightWithTopAligned,
       direction: direction ?? PopoverDirection.rightWithTopAligned,
       child: TextButton(child: Text(label), onPressed: () {}),
       child: TextButton(child: Text(label), onPressed: () {}),

+ 1 - 1
frontend/app_flowy/packages/appflowy_popover/example/lib/main.dart

@@ -1,4 +1,4 @@
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import "./example_button.dart";
 import "./example_button.dart";
 
 

+ 5 - 0
frontend/app_flowy/packages/appflowy_popover/lib/appflowy_popover.dart

@@ -0,0 +1,5 @@
+/// AppFlowyBoard library
+library appflowy_popover;
+
+export 'src/mutex.dart';
+export 'src/popover.dart';

+ 0 - 0
frontend/app_flowy/packages/appflowy_popover/lib/follower.dart → frontend/app_flowy/packages/appflowy_popover/lib/src/follower.dart


+ 0 - 0
frontend/app_flowy/packages/appflowy_popover/lib/layout.dart → frontend/app_flowy/packages/appflowy_popover/lib/src/layout.dart


+ 54 - 0
frontend/app_flowy/packages/appflowy_popover/lib/src/mask.dart

@@ -0,0 +1,54 @@
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+
+class _PopoverMask extends StatefulWidget {
+  final void Function() onTap;
+  final void Function()? onExit;
+  final Decoration? decoration;
+
+  const _PopoverMask(
+      {Key? key,
+      required this.onTap,
+      this.onExit,
+      this.decoration =
+          const BoxDecoration(color: Color.fromARGB(0, 244, 67, 54))})
+      : super(key: key);
+
+  @override
+  State<StatefulWidget> createState() => _PopoverMaskState();
+}
+
+class _PopoverMaskState extends State<_PopoverMask> {
+  @override
+  void initState() {
+    HardwareKeyboard.instance.addHandler(_handleGlobalKeyEvent);
+    super.initState();
+  }
+
+  bool _handleGlobalKeyEvent(KeyEvent event) {
+    if (event.logicalKey == LogicalKeyboardKey.escape) {
+      if (widget.onExit != null) {
+        widget.onExit!();
+      }
+
+      return true;
+    }
+    return false;
+  }
+
+  @override
+  void deactivate() {
+    HardwareKeyboard.instance.removeHandler(_handleGlobalKeyEvent);
+    super.deactivate();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return GestureDetector(
+      onTap: widget.onTap,
+      child: Container(
+        decoration: widget.decoration,
+      ),
+    );
+  }
+}

+ 44 - 0
frontend/app_flowy/packages/appflowy_popover/lib/src/mutex.dart

@@ -0,0 +1,44 @@
+import 'package:flutter/material.dart';
+
+import 'popover.dart';
+
+/// If multiple popovers are exclusive,
+/// pass the same mutex to them.
+class PopoverMutex {
+  final ValueNotifier<PopoverState?> _stateNotifier = ValueNotifier(null);
+  PopoverMutex();
+
+  void removePopoverStateListener(VoidCallback listener) {
+    _stateNotifier.removeListener(listener);
+  }
+
+  VoidCallback listenOnPopoverStateChanged(VoidCallback callback) {
+    listenerCallback() {
+      callback();
+    }
+
+    _stateNotifier.addListener(listenerCallback);
+    return listenerCallback;
+  }
+
+  void close() {
+    _stateNotifier.value?.close();
+  }
+
+  PopoverState? get state => _stateNotifier.value;
+
+  set state(PopoverState? newState) {
+    if (_stateNotifier.value != null && _stateNotifier.value != newState) {
+      _stateNotifier.value?.close();
+    }
+    _stateNotifier.value = newState;
+  }
+
+  void removeState() {
+    _stateNotifier.value = null;
+  }
+
+  void dispose() {
+    _stateNotifier.dispose();
+  }
+}

+ 36 - 129
frontend/app_flowy/packages/appflowy_popover/lib/popover.dart → frontend/app_flowy/packages/appflowy_popover/lib/src/popover.dart

@@ -1,62 +1,23 @@
-import 'package:appflowy_popover/layout.dart';
+import 'package:appflowy_popover/src/layout.dart';
 import 'package:flutter/gestures.dart';
 import 'package:flutter/gestures.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
 
 
-/// If multiple popovers are exclusive,
-/// pass the same mutex to them.
-class PopoverMutex {
-  final ValueNotifier<PopoverState?> _stateNotifier = ValueNotifier(null);
-  PopoverMutex();
-
-  void removePopoverStateListener(VoidCallback listener) {
-    _stateNotifier.removeListener(listener);
-  }
-
-  VoidCallback listenOnPopoverStateChanged(VoidCallback callback) {
-    listenerCallback() {
-      callback();
-    }
-
-    _stateNotifier.addListener(listenerCallback);
-    return listenerCallback;
-  }
-
-  void close() {
-    _stateNotifier.value?.close();
-  }
-
-  PopoverState? get state => _stateNotifier.value;
-
-  set state(PopoverState? newState) {
-    if (_stateNotifier.value != null && _stateNotifier.value != newState) {
-      _stateNotifier.value?.close();
-    }
-    _stateNotifier.value = newState;
-  }
-
-  void _removeState() {
-    _stateNotifier.value = null;
-  }
-
-  void dispose() {
-    _stateNotifier.dispose();
-  }
-}
+import 'mask.dart';
+import 'mutex.dart';
 
 
 class PopoverController {
 class PopoverController {
-  PopoverState? state;
+  PopoverState? _state;
 
 
   close() {
   close() {
-    state?.close();
+    _state?.close();
   }
   }
 
 
   show() {
   show() {
-    state?.showOverlay();
+    _state?.showOverlay();
   }
   }
 }
 }
 
 
-class PopoverTriggerActionFlags {
+class PopoverTriggerFlags {
   static int click = 0x01;
   static int click = 0x01;
   static int hover = 0x02;
   static int hover = 0x02;
 }
 }
@@ -136,11 +97,11 @@ class PopoverState extends State<Popover> {
 
 
   @override
   @override
   void initState() {
   void initState() {
-    widget.controller?.state = this;
+    widget.controller?._state = this;
     super.initState();
     super.initState();
   }
   }
 
 
-  showOverlay() {
+  void showOverlay() {
     close();
     close();
 
 
     if (widget.mutex != null) {
     if (widget.mutex != null) {
@@ -150,14 +111,14 @@ class PopoverState extends State<Popover> {
     if (_popoverWithMask == null) {
     if (_popoverWithMask == null) {
       _popoverWithMask = this;
       _popoverWithMask = this;
     } else {
     } else {
-      hasMask = false;
+      // hasMask = false;
     }
     }
 
 
     final newEntry = OverlayEntry(builder: (context) {
     final newEntry = OverlayEntry(builder: (context) {
       final children = <Widget>[];
       final children = <Widget>[];
 
 
       if (hasMask) {
       if (hasMask) {
-        children.add(_PopoverMask(
+        children.add(PopoverMask(
           decoration: widget.maskDecoration,
           decoration: widget.maskDecoration,
           onTap: () => close(),
           onTap: () => close(),
           onExit: () => close(),
           onExit: () => close(),
@@ -178,27 +139,29 @@ class PopoverState extends State<Popover> {
 
 
     _overlayEntry = newEntry;
     _overlayEntry = newEntry;
 
 
+    final OverlayState s = Overlay.of(context)!;
+
     Overlay.of(context)?.insert(newEntry);
     Overlay.of(context)?.insert(newEntry);
   }
   }
 
 
-  close() {
+  void close() {
     if (_overlayEntry != null) {
     if (_overlayEntry != null) {
       _overlayEntry!.remove();
       _overlayEntry!.remove();
       _overlayEntry = null;
       _overlayEntry = null;
+
       if (_popoverWithMask == this) {
       if (_popoverWithMask == this) {
         _popoverWithMask = null;
         _popoverWithMask = null;
       }
       }
-      if (widget.onClose != null) {
-        widget.onClose!();
-      }
+
+      widget.onClose?.call();
     }
     }
 
 
     if (widget.mutex?.state == this) {
     if (widget.mutex?.state == this) {
-      widget.mutex?._removeState();
+      widget.mutex?.removeState();
     }
     }
   }
   }
 
 
-  closeAll() {
+  void closeAll() {
     _popoverWithMask?.close();
     _popoverWithMask?.close();
   }
   }
 
 
@@ -208,88 +171,32 @@ class PopoverState extends State<Popover> {
     super.deactivate();
     super.deactivate();
   }
   }
 
 
-  _handleTargetPointerDown(PointerDownEvent event) {
-    if (widget.triggerActions & PopoverTriggerActionFlags.click != 0) {
-      showOverlay();
-    }
-  }
-
-  _handleTargetPointerEnter(PointerEnterEvent event) {
-    if (widget.triggerActions & PopoverTriggerActionFlags.hover != 0) {
-      showOverlay();
-    }
-  }
-
-  _buildContent(BuildContext context) {
-    if (widget.triggerActions == 0) {
-      return widget.child;
-    }
-
-    return MouseRegion(
-      onEnter: _handleTargetPointerEnter,
-      child: Listener(
-        onPointerDown: _handleTargetPointerDown,
-        child: widget.child,
-      ),
-    );
-  }
-
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     return PopoverTarget(
     return PopoverTarget(
       link: popoverLink,
       link: popoverLink,
-      child: _buildContent(context),
+      child: _buildChild(context),
     );
     );
   }
   }
-}
-
-class _PopoverMask extends StatefulWidget {
-  final void Function() onTap;
-  final void Function()? onExit;
-  final Decoration? decoration;
 
 
-  const _PopoverMask(
-      {Key? key, required this.onTap, this.onExit, this.decoration})
-      : super(key: key);
-
-  @override
-  State<StatefulWidget> createState() => _PopoverMaskState();
-}
-
-class _PopoverMaskState extends State<_PopoverMask> {
-  @override
-  void initState() {
-    HardwareKeyboard.instance.addHandler(_handleGlobalKeyEvent);
-    super.initState();
-  }
-
-  bool _handleGlobalKeyEvent(KeyEvent event) {
-    if (event.logicalKey == LogicalKeyboardKey.escape) {
-      if (widget.onExit != null) {
-        widget.onExit!();
-      }
-
-      return true;
+  Widget _buildChild(BuildContext context) {
+    if (widget.triggerActions == 0) {
+      return widget.child;
     }
     }
-    return false;
-  }
-
-  @override
-  void deactivate() {
-    HardwareKeyboard.instance.removeHandler(_handleGlobalKeyEvent);
-    super.deactivate();
-  }
 
 
-  @override
-  Widget build(BuildContext context) {
-    return GestureDetector(
-      onTap: widget.onTap,
-      child: Container(
-        // decoration: widget.decoration,
-        decoration: widget.decoration ??
-            const BoxDecoration(
-              color: Color.fromARGB(0, 244, 67, 54),
-            ),
+    return MouseRegion(
+      onEnter: (PointerEnterEvent event) {
+        if (widget.triggerActions & PopoverTriggerFlags.hover != 0) {
+          showOverlay();
+        }
+      },
+      child: Listener(
+        child: widget.child,
+        onPointerDown: (PointerDownEvent event) {
+          if (widget.triggerActions & PopoverTriggerFlags.click != 0) {
+            showOverlay();
+          }
+        },
       ),
       ),
     );
     );
   }
   }

+ 1 - 1
frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/appflowy_stype_popover.dart

@@ -1,5 +1,5 @@
 import 'package:flowy_infra_ui/flowy_infra_ui_web.dart';
 import 'package:flowy_infra_ui/flowy_infra_ui_web.dart';
-import 'package:appflowy_popover/popover.dart';
+import 'package:appflowy_popover/appflowy_popover.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 
 
 class AppFlowyPopover extends StatelessWidget {
 class AppFlowyPopover extends StatelessWidget {