From 286c89bf74c523a16a5f5c5190cb522907cc1c67 Mon Sep 17 00:00:00 2001 From: Cyrine-benabid Date: Sun, 30 Oct 2022 20:30:38 +0100 Subject: [PATCH] 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(); - }, ); }, );