From 3e76fa8e4278fa311f0f5f4cca5fcca3054152fe Mon Sep 17 00:00:00 2001 From: Cyrine ben-abid Date: Wed, 26 Oct 2022 11:39:41 +0200 Subject: [PATCH 01/10] fix: close popover on add option button clicked and textfield focused --- .../widgets/common/text_field.dart | 6 ++++ .../header/type_option/select_option.dart | 31 ++++++++++++++----- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart index abb0af7d58..b2cf30faea 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart @@ -9,6 +9,7 @@ class InputTextField extends StatefulWidget { final void Function(String)? onDone; final void Function(String)? onChanged; final void Function() onCanceled; + final void Function()? onFocused; final bool autoClearWhenDone; final String text; final int? maxLength; @@ -18,6 +19,7 @@ class InputTextField extends StatefulWidget { this.onDone, required this.onCanceled, this.onChanged, + this.onFocused, this.autoClearWhenDone = false, this.maxLength, Key? key, @@ -90,6 +92,10 @@ class _InputTextFieldState extends State { widget.onDone!(_controller.text); } } + } else { + if (widget.onFocused != null) { + widget.onFocused!(); + } } } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index ee35d208f9..aabeca9646 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -43,11 +43,15 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { builder: (context, state) { List children = [ const TypeOptionSeparator(), - const OptionTitle(), + OptionTitle( + popoverMutex: popoverMutex, + ), if (state.isEditingOption) - const Padding( - padding: EdgeInsets.only(bottom: 10), - child: _CreateOptionTextField(), + Padding( + padding: const EdgeInsets.only(bottom: 10), + child: _CreateOptionTextField( + popoverMutex: popoverMutex, + ), ), if (state.options.isEmpty && !state.isEditingOption) const _AddOptionButton(), @@ -62,7 +66,9 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { } class OptionTitle extends StatelessWidget { - const OptionTitle({Key? key}) : super(key: key); + final PopoverMutex? popoverMutex; + + const OptionTitle({this.popoverMutex, Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -78,7 +84,9 @@ class OptionTitle extends StatelessWidget { ]; if (state.options.isNotEmpty && !state.isEditingOption) { children.add(const Spacer()); - children.add(const _OptionTitleButton()); + children.add(_OptionTitleButton( + popoverMutex: popoverMutex, + )); } return SizedBox( @@ -91,7 +99,9 @@ class OptionTitle extends StatelessWidget { } class _OptionTitleButton extends StatelessWidget { - const _OptionTitleButton({Key? key}) : super(key: key); + final PopoverMutex? popoverMutex; + + const _OptionTitleButton({this.popoverMutex, Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -107,6 +117,7 @@ class _OptionTitleButton extends StatelessWidget { ), hoverColor: theme.hover, onTap: () { + popoverMutex?.close(); context .read() .add(const SelectOptionTypeOptionEvent.addingOption()); @@ -252,7 +263,8 @@ class _AddOptionButton extends StatelessWidget { } class _CreateOptionTextField extends StatelessWidget { - const _CreateOptionTextField({Key? key}) : super(key: key); + final PopoverMutex? popoverMutex; + const _CreateOptionTextField({this.popoverMutex, Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -273,6 +285,9 @@ class _CreateOptionTextField extends StatelessWidget { .read() .add(SelectOptionTypeOptionEvent.createOption(optionName)); }, + onFocused: () { + popoverMutex?.close(); + }, ); }, ); From b7f369b3d9c132fc3613d742b067e73c52c38778 Mon Sep 17 00:00:00 2001 From: Cyrine ben-abid Date: Wed, 26 Oct 2022 11:48:26 +0200 Subject: [PATCH 02/10] feat: close popover on text field tap --- .../grid/presentation/widgets/common/text_field.dart | 8 ++++++++ .../widgets/header/type_option/select_option.dart | 3 +++ .../flowy_infra_ui/lib/widget/rounded_input_field.dart | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart index b2cf30faea..84e169d258 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart @@ -10,6 +10,8 @@ class InputTextField extends StatefulWidget { final void Function(String)? onChanged; final void Function() onCanceled; final void Function()? onFocused; + final void Function()? onTap; + final bool autoClearWhenDone; final String text; final int? maxLength; @@ -20,6 +22,7 @@ class InputTextField extends StatefulWidget { required this.onCanceled, this.onChanged, this.onFocused, + this.onTap, this.autoClearWhenDone = false, this.maxLength, Key? key, @@ -73,6 +76,11 @@ class _InputTextFieldState extends State { _controller.text = ""; } }, + onTap: () { + if (widget.onTap != null) { + widget.onTap!(); + } + }, ); } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index aabeca9646..f20d9460e1 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -288,6 +288,9 @@ class _CreateOptionTextField extends StatelessWidget { onFocused: () { popoverMutex?.close(); }, + onTap: () { + popoverMutex?.close(); + }, ); }, ); diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart index 9dec787c2e..becdfd8b06 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart @@ -19,6 +19,7 @@ class RoundedInputField extends StatefulWidget { final TextStyle style; final ValueChanged? onChanged; final Function(String)? onEditingComplete; + final Function()? onTap; final String? initialValue; final EdgeInsets margin; final EdgeInsets padding; @@ -39,6 +40,7 @@ class RoundedInputField extends StatefulWidget { this.obscureHideIcon, this.onChanged, this.onEditingComplete, + this.onTap, this.normalBorderColor = Colors.transparent, this.errorBorderColor = Colors.transparent, this.focusBorderColor, @@ -109,6 +111,11 @@ class _RoundedInputFieldState extends State { widget.onEditingComplete!(inputText); } }, + onTap: () { + if (widget.onTap != null) { + widget.onTap!(); + } + }, cursorColor: widget.cursorColor, obscureText: obscuteText, style: widget.style, From baeedf557d16c1a1db366c8aff79b220f321ea3d Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 02:24:57 +0200 Subject: [PATCH 03/10] feat: close popover on AddOptionButton tap --- .../widgets/header/type_option/select_option.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index f20d9460e1..3b69f1f2ab 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -54,7 +54,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { ), ), if (state.options.isEmpty && !state.isEditingOption) - const _AddOptionButton(), + _AddOptionButton(popoverMutex: popoverMutex), _OptionList(popoverMutex: popoverMutex) ]; @@ -240,7 +240,11 @@ class _OptionCellState extends State<_OptionCell> { } class _AddOptionButton extends StatelessWidget { - const _AddOptionButton({Key? key}) : super(key: key); + final PopoverMutex? popoverMutex; + const _AddOptionButton({ + Key? key, + this.popoverMutex, + }) : super(key: key); @override Widget build(BuildContext context) { @@ -252,6 +256,7 @@ class _AddOptionButton extends StatelessWidget { fontSize: 12), hoverColor: theme.hover, onTap: () { + popoverMutex?.close(); context .read() .add(const SelectOptionTypeOptionEvent.addingOption()); From 1a53a0e37594afb1bc6d5d4f68021be149ca5931 Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 16:43:30 +0100 Subject: [PATCH 04/10] refactor: implementation using focusNode --- .../widgets/common/text_field.dart | 16 +++++----- .../header/type_option/select_option.dart | 30 +++++++++++++++---- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart index 84e169d258..bc28298f17 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart @@ -9,22 +9,21 @@ class InputTextField extends StatefulWidget { final void Function(String)? onDone; final void Function(String)? onChanged; final void Function() onCanceled; - final void Function()? onFocused; final void Function()? onTap; - final bool autoClearWhenDone; final String text; final int? maxLength; + final FocusNode? focusNode; const InputTextField({ required this.text, this.onDone, required this.onCanceled, this.onChanged, - this.onFocused, this.onTap, this.autoClearWhenDone = false, this.maxLength, + this.focusNode, Key? key, }) : super(key: key); @@ -39,7 +38,7 @@ class _InputTextFieldState extends State { @override void initState() { - _focusNode = FocusNode(); + _focusNode = widget.focusNode ?? FocusNode(); _controller = TextEditingController(text: widget.text); _focusNode.addListener(notifyDidEndEditing); @@ -87,7 +86,10 @@ class _InputTextFieldState extends State { @override void dispose() { _focusNode.removeListener(notifyDidEndEditing); - _focusNode.dispose(); + // only dispose the focusNode if it was created in this widget's initState + if (widget.focusNode == null) { + _focusNode.dispose(); + } super.dispose(); } @@ -100,10 +102,6 @@ class _InputTextFieldState extends State { widget.onDone!(_controller.text); } } - } else { - if (widget.onFocused != null) { - widget.onFocused!(); - } } } } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index 3b69f1f2ab..fec93c1c47 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -267,9 +267,29 @@ class _AddOptionButton extends StatelessWidget { } } -class _CreateOptionTextField extends StatelessWidget { +class _CreateOptionTextField extends StatefulWidget { final PopoverMutex? popoverMutex; - const _CreateOptionTextField({this.popoverMutex, Key? key}) : super(key: key); + const _CreateOptionTextField({ + super.key, + this.popoverMutex, + }); + + @override + State<_CreateOptionTextField> createState() => __CreateOptionTextFieldState(); +} + +class __CreateOptionTextFieldState extends State<_CreateOptionTextField> { + late final FocusNode _focusNode; + + @override + void initState() { + _focusNode = FocusNode(); + _focusNode.addListener(() { + if (_focusNode.hasFocus) { + widget.popoverMutex?.close(); + } + }); + } @override Widget build(BuildContext context) { @@ -280,6 +300,7 @@ class _CreateOptionTextField extends StatelessWidget { autoClearWhenDone: true, maxLength: 30, text: text, + focusNode: _focusNode, onCanceled: () { context .read() @@ -290,11 +311,8 @@ class _CreateOptionTextField extends StatelessWidget { .read() .add(SelectOptionTypeOptionEvent.createOption(optionName)); }, - onFocused: () { - popoverMutex?.close(); - }, onTap: () { - popoverMutex?.close(); + widget.popoverMutex?.close(); }, ); }, From 16a8dbc6cef0569f420935ef5c191d7f39560c69 Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 18:27:12 +0100 Subject: [PATCH 05/10] feat: unfocus CreateOptionTextField when popover state changes --- .../widgets/header/type_option/select_option.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index fec93c1c47..eeb1278923 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -289,6 +289,11 @@ class __CreateOptionTextFieldState extends State<_CreateOptionTextField> { widget.popoverMutex?.close(); } }); + widget.popoverMutex?.listenOnPopoverChanged(() { + if (_focusNode.hasFocus) { + _focusNode.unfocus(); + } + }); } @override From 8f1752a253dfc257c87872e2c2e030ae640ae2de Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 19:30:56 +0100 Subject: [PATCH 06/10] fix: add missing super.initState() call --- .../presentation/widgets/header/type_option/select_option.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index eeb1278923..36a200454b 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -294,6 +294,7 @@ class __CreateOptionTextFieldState extends State<_CreateOptionTextField> { _focusNode.unfocus(); } }); + super.initState(); } @override From fad02eb09d95ef06e159f1bf0af6b66799fea416 Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 20:19:20 +0100 Subject: [PATCH 07/10] fix: remove useless onTap --- .../grid/presentation/widgets/common/text_field.dart | 7 ------- .../widgets/header/type_option/select_option.dart | 1 - .../flowy_infra_ui/lib/widget/rounded_input_field.dart | 7 ------- 3 files changed, 15 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart index bc28298f17..cbb28ae1c7 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/common/text_field.dart @@ -9,7 +9,6 @@ class InputTextField extends StatefulWidget { final void Function(String)? onDone; final void Function(String)? onChanged; final void Function() onCanceled; - final void Function()? onTap; final bool autoClearWhenDone; final String text; final int? maxLength; @@ -20,7 +19,6 @@ class InputTextField extends StatefulWidget { this.onDone, required this.onCanceled, this.onChanged, - this.onTap, this.autoClearWhenDone = false, this.maxLength, this.focusNode, @@ -75,11 +73,6 @@ class _InputTextFieldState extends State { _controller.text = ""; } }, - onTap: () { - if (widget.onTap != null) { - widget.onTap!(); - } - }, ); } diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index 36a200454b..0deba533de 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -256,7 +256,6 @@ class _AddOptionButton extends StatelessWidget { fontSize: 12), hoverColor: theme.hover, onTap: () { - popoverMutex?.close(); context .read() .add(const SelectOptionTypeOptionEvent.addingOption()); diff --git a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart index becdfd8b06..9dec787c2e 100644 --- a/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart +++ b/frontend/app_flowy/packages/flowy_infra_ui/lib/widget/rounded_input_field.dart @@ -19,7 +19,6 @@ class RoundedInputField extends StatefulWidget { final TextStyle style; final ValueChanged? onChanged; final Function(String)? onEditingComplete; - final Function()? onTap; final String? initialValue; final EdgeInsets margin; final EdgeInsets padding; @@ -40,7 +39,6 @@ class RoundedInputField extends StatefulWidget { this.obscureHideIcon, this.onChanged, this.onEditingComplete, - this.onTap, this.normalBorderColor = Colors.transparent, this.errorBorderColor = Colors.transparent, this.focusBorderColor, @@ -111,11 +109,6 @@ class _RoundedInputFieldState extends State { widget.onEditingComplete!(inputText); } }, - onTap: () { - if (widget.onTap != null) { - widget.onTap!(); - } - }, cursorColor: widget.cursorColor, obscureText: obscuteText, style: widget.style, From 339e3d242feccb2416e5cf5f6341975dda2fe6ce Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 20:20:13 +0100 Subject: [PATCH 08/10] style: rename class and fix constructor --- .../widgets/header/type_option/select_option.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index 0deba533de..4d41d4edff 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -269,15 +269,15 @@ class _AddOptionButton extends StatelessWidget { class _CreateOptionTextField extends StatefulWidget { final PopoverMutex? popoverMutex; const _CreateOptionTextField({ - super.key, + Key? key, this.popoverMutex, - }); + }) : super(key: key); @override - State<_CreateOptionTextField> createState() => __CreateOptionTextFieldState(); + State<_CreateOptionTextField> createState() => _CreateOptionTextFieldState(); } -class __CreateOptionTextFieldState extends State<_CreateOptionTextField> { +class _CreateOptionTextFieldState extends State<_CreateOptionTextField> { late final FocusNode _focusNode; @override From 286c89bf74c523a16a5f5c5190cb522907cc1c67 Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 20:30:38 +0100 Subject: [PATCH 09/10] refactor: remove useless onTap and don't pass popovermutex when not needed --- .../header/type_option/select_option.dart | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index 4d41d4edff..047c0997c9 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -43,9 +43,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { builder: (context, state) { List children = [ const TypeOptionSeparator(), - OptionTitle( - popoverMutex: popoverMutex, - ), + const OptionTitle(), if (state.isEditingOption) Padding( padding: const EdgeInsets.only(bottom: 10), @@ -66,9 +64,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { } class OptionTitle extends StatelessWidget { - final PopoverMutex? popoverMutex; - - const OptionTitle({this.popoverMutex, Key? key}) : super(key: key); + const OptionTitle({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -84,9 +80,7 @@ class OptionTitle extends StatelessWidget { ]; if (state.options.isNotEmpty && !state.isEditingOption) { children.add(const Spacer()); - children.add(_OptionTitleButton( - popoverMutex: popoverMutex, - )); + children.add(const _OptionTitleButton()); } return SizedBox( @@ -99,9 +93,7 @@ class OptionTitle extends StatelessWidget { } class _OptionTitleButton extends StatelessWidget { - final PopoverMutex? popoverMutex; - - const _OptionTitleButton({this.popoverMutex, Key? key}) : super(key: key); + const _OptionTitleButton({Key? key}) : super(key: key); @override Widget build(BuildContext context) { @@ -117,7 +109,6 @@ class _OptionTitleButton extends StatelessWidget { ), hoverColor: theme.hover, onTap: () { - popoverMutex?.close(); context .read() .add(const SelectOptionTypeOptionEvent.addingOption()); @@ -316,9 +307,6 @@ class _CreateOptionTextFieldState extends State<_CreateOptionTextField> { .read() .add(SelectOptionTypeOptionEvent.createOption(optionName)); }, - onTap: () { - widget.popoverMutex?.close(); - }, ); }, ); From c7d8a0b7c396ec2fd8ddb9017a6867d4a9e4648b Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Mon, 31 Oct 2022 06:48:28 +0100 Subject: [PATCH 10/10] refactor: remove useless popoverMutex from _AddOptionButton widget --- .../widgets/header/type_option/select_option.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart index 047c0997c9..7463509e02 100644 --- a/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart +++ b/frontend/app_flowy/lib/plugins/grid/presentation/widgets/header/type_option/select_option.dart @@ -52,7 +52,7 @@ class SelectOptionTypeOptionWidget extends StatelessWidget { ), ), if (state.options.isEmpty && !state.isEditingOption) - _AddOptionButton(popoverMutex: popoverMutex), + const _AddOptionButton(), _OptionList(popoverMutex: popoverMutex) ]; @@ -231,11 +231,7 @@ class _OptionCellState extends State<_OptionCell> { } class _AddOptionButton extends StatelessWidget { - final PopoverMutex? popoverMutex; - const _AddOptionButton({ - Key? key, - this.popoverMutex, - }) : super(key: key); + const _AddOptionButton({Key? key}) : super(key: key); @override Widget build(BuildContext context) {