Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

refactor: remove useless onTap and don't pass popovermutex when not needed

Cyrine-benabid286c89bf74c5
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<Widget> 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<SelectOptionTypeOptionBloc>()
.add(const SelectOptionTypeOptionEvent.addingOption());
@@ -316,9 +307,6 @@ class _CreateOptionTextFieldState extends State<_CreateOptionTextField> {
.read<SelectOptionTypeOptionBloc>()
.add(SelectOptionTypeOptionEvent.createOption(optionName));
},
- onTap: () {
- widget.popoverMutex?.close();
- },
);
},
);