diff --git a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart index 8814d83a5e..5998b4d7d4 100644 --- a/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart +++ b/frontend/app_flowy/lib/plugins/board/presentation/card/board_select_option_cell.dart @@ -56,23 +56,23 @@ class _BoardSelectOptionCellState extends State { (option) => SelectOptionTag.fromOption( context: context, option: option, + onSelected: () { + SelectOptionCellEditor.show( + context: context, + cellController: widget.cellControllerBuilder.build() + as GridSelectOptionCellController, + ); + }, ), ) .toList(); return IntrinsicHeight( - child: Stack( - alignment: AlignmentDirectional.center, - fit: StackFit.expand, - children: [ - Padding( - padding: const EdgeInsets.symmetric(vertical: 6), - child: Wrap(spacing: 4, runSpacing: 2, children: children), - ), - _SelectOptionDialog( - controller: widget.cellControllerBuilder.build(), - ), - ], + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 6), + child: SizedBox.expand( + child: Wrap(spacing: 4, runSpacing: 2, children: children), + ), ), ); } @@ -98,12 +98,13 @@ class _SelectOptionDialog extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell(onTap: () { - SelectOptionCellEditor.show( - context, - _controller, - () {}, - ); - }); + return SizedBox( + child: InkWell(onTap: () { + SelectOptionCellEditor.show( + context: context, + cellController: _controller, + ); + }), + ); } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart index c771586e70..5355175ae8 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_cell.dart @@ -183,9 +183,10 @@ class SelectOptionWrap extends StatelessWidget { InkWell(onTap: () { onFocus?.call(true); SelectOptionCellEditor.show( - context, - cellControllerBuilder.build() as GridSelectOptionCellController, - () => onFocus?.call(false), + context: context, + cellController: + cellControllerBuilder.build() as GridSelectOptionCellController, + onDismissed: () => onFocus?.call(false), ); }), ], diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart index ef0dab83c9..fcb0d8c868 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/select_option_cell/select_option_editor.dart @@ -26,11 +26,11 @@ const double _editorPannelWidth = 300; class SelectOptionCellEditor extends StatelessWidget with FlowyOverlayDelegate { final GridSelectOptionCellController cellController; - final VoidCallback onDismissed; + final VoidCallback? onDismissed; const SelectOptionCellEditor({ required this.cellController, - required this.onDismissed, + this.onDismissed, Key? key, }) : super(key: key); @@ -58,14 +58,14 @@ class SelectOptionCellEditor extends StatelessWidget with FlowyOverlayDelegate { ); } - static void show( - BuildContext context, - GridSelectOptionCellController cellContext, - VoidCallback onDismissed, - ) { + static void show({ + required BuildContext context, + required GridSelectOptionCellController cellController, + VoidCallback? onDismissed, + }) { SelectOptionCellEditor.remove(context); final editor = SelectOptionCellEditor( - cellController: cellContext, + cellController: cellController, onDismissed: onDismissed, ); @@ -94,7 +94,7 @@ class SelectOptionCellEditor extends StatelessWidget with FlowyOverlayDelegate { bool asBarrier() => true; @override - void didRemove() => onDismissed(); + void didRemove() => onDismissed?.call(); } class _OptionList extends StatelessWidget {