Skip to content

Commit d35727b

Browse files
committed
chore: make some overlay as barrier
1 parent 723b34a commit d35727b

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

frontend/app_flowy/lib/plugins/grid/presentation/widgets/cell/date_cell/date_editor.dart

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -339,36 +339,30 @@ class _CalDateTimeSettingState extends State<_CalDateTimeSetting> {
339339
@override
340340
Widget build(BuildContext context) {
341341
List<Widget> children = [
342-
Popover(
342+
AppFlowyPopover(
343343
mutex: _popoverMutex,
344344
asBarrier: true,
345345
triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
346346
offset: const Offset(20, 0),
347347
popupBuilder: (BuildContext context) {
348-
return OverlayContainer(
349-
constraints: BoxConstraints.loose(const Size(460, 440)),
350-
child: DateFormatList(
351-
selectedFormat: widget.dateTypeOptionPB.dateFormat,
352-
onSelected: (format) =>
353-
widget.onEvent(DateCalEvent.setDateFormat(format)),
354-
),
348+
return DateFormatList(
349+
selectedFormat: widget.dateTypeOptionPB.dateFormat,
350+
onSelected: (format) =>
351+
widget.onEvent(DateCalEvent.setDateFormat(format)),
355352
);
356353
},
357354
child: const DateFormatButton(),
358355
),
359-
Popover(
356+
AppFlowyPopover(
360357
mutex: _popoverMutex,
361358
asBarrier: true,
362359
triggerActions: PopoverTriggerFlags.hover | PopoverTriggerFlags.click,
363360
offset: const Offset(20, 0),
364361
popupBuilder: (BuildContext context) {
365-
return OverlayContainer(
366-
constraints: BoxConstraints.loose(const Size(460, 440)),
367-
child: TimeFormatList(
368-
selectedFormat: widget.dateTypeOptionPB.timeFormat,
369-
onSelected: (format) =>
370-
widget.onEvent(DateCalEvent.setTimeFormat(format)),
371-
),
362+
return TimeFormatList(
363+
selectedFormat: widget.dateTypeOptionPB.timeFormat,
364+
onSelected: (format) =>
365+
widget.onEvent(DateCalEvent.setTimeFormat(format)),
372366
);
373367
},
374368
child: TimeFormatButton(timeFormat: widget.dateTypeOptionPB.timeFormat),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ class _SelectOptionCellState extends State<_SelectOptionCell> {
243243
return AppFlowyPopover(
244244
controller: _popoverController,
245245
offset: const Offset(20, 0),
246+
asBarrier: true,
246247
constraints: BoxConstraints.loose(const Size(200, 300)),
247248
mutex: widget.popoverMutex,
248249
child: SizedBox(

frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/field_type_option_editor.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class FieldTypeOptionEditor extends StatelessWidget {
6666
height: GridSize.typeOptionItemHeight,
6767
child: AppFlowyPopover(
6868
constraints: BoxConstraints.loose(const Size(460, 440)),
69+
asBarrier: true,
6970
triggerActions: PopoverTriggerFlags.click | PopoverTriggerFlags.hover,
7071
mutex: popoverMutex,
7172
offset: const Offset(20, 0),

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ class CreateFieldButton extends StatelessWidget {
179179
return AppFlowyPopover(
180180
triggerActions: PopoverTriggerFlags.click,
181181
direction: PopoverDirection.bottomWithRightAligned,
182-
constraints: BoxConstraints.loose(const Size(240, 200)),
182+
asBarrier: true,
183+
constraints: BoxConstraints.loose(const Size(240, 600)),
183184
child: FlowyButton(
184185
text: FlowyText.medium(
185186
LocaleKeys.grid_field_newColumn.tr(),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ class _OptionCellState extends State<_OptionCell> {
184184
controller: _popoverController,
185185
mutex: widget.popoverMutex,
186186
offset: const Offset(20, 0),
187+
asBarrier: true,
187188
constraints: BoxConstraints.loose(const Size(460, 440)),
188189
child: SizedBox(
189190
height: GridSize.typeOptionItemHeight,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ class _RowDetailCellState extends State<_RowDetailCell> {
274274
offset: const Offset(20, 0),
275275
popupBuilder: (popoverContext) {
276276
return OverlayContainer(
277-
constraints: BoxConstraints.loose(const Size(240, 200)),
277+
constraints: BoxConstraints.loose(const Size(240, 600)),
278278
child: FieldEditor(
279279
gridId: widget.cellId.gridId,
280280
fieldName: widget.cellId.fieldContext.field.name,

frontend/app_flowy/packages/flowy_infra_ui/lib/src/flowy_overlay/appflowy_stype_popover.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class AppFlowyPopover extends StatelessWidget {
1212
final void Function()? onClose;
1313
final PopoverMutex? mutex;
1414
final Offset? offset;
15+
final bool asBarrier;
1516

1617
const AppFlowyPopover({
1718
Key? key,
@@ -24,6 +25,7 @@ class AppFlowyPopover extends StatelessWidget {
2425
this.triggerActions = 0,
2526
this.offset,
2627
this.controller,
28+
this.asBarrier = false,
2729
}) : super(key: key);
2830

2931
@override
@@ -33,6 +35,7 @@ class AppFlowyPopover extends StatelessWidget {
3335
onClose: onClose,
3436
direction: direction,
3537
mutex: mutex,
38+
asBarrier: asBarrier,
3639
triggerActions: triggerActions,
3740
popupBuilder: (context) {
3841
final child = popupBuilder(context);

0 commit comments

Comments
 (0)