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.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
fix: space button rebuild issue (#6235)
Mathias Mogensen06c356c7a1d0
diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dartindex 9d6e41ca08..3b6845df37 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/space/sidebar_space_header.dart@@ -64,8 +64,8 @@ class _SidebarSpaceHeaderState extends State<SidebarSpaceHeader> {.read<SpaceBloc>().add(SpaceEvent.expand(widget.space, !widget.isExpanded)),child: FlowyHoverContainer(- isHovering: isHovered,style: style,+ applyStyle: isHovered,child: _buildSpaceName(),),);diff --git a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dartindex 80ff69d259..f9bebb457a 100644--- a/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart+++ b/frontend/appflowy_flutter/packages/flowy_infra_ui/lib/style_widget/hover.dart@@ -61,9 +61,9 @@ class _FlowyHoverState extends State<FlowyHover> {onEnter: (_) => _setOnHover(true),onExit: (_) => _setOnHover(false),child: FlowyHoverContainer(- isHovering: _onHover || (widget.isSelected?.call() ?? false),style: widget.style ??HoverStyle(hoverColor: Theme.of(context).colorScheme.secondary),+ applyStyle: _onHover || (widget.isSelected?.call() ?? false),child: widget.child ?? widget.builder!(context, _onHover),),);@@ -113,27 +113,17 @@ class HoverStyle {class FlowyHoverContainer extends StatelessWidget {final HoverStyle style;final Widget child;- final bool isHovering;+ final bool applyStyle;const FlowyHoverContainer({super.key,required this.child,required this.style,- required this.isHovering,+ this.applyStyle = false,});@overrideWidget build(BuildContext context) {- if (!isHovering) {- return Container(- decoration: BoxDecoration(- color: style.backgroundColor,- borderRadius: style.borderRadius,- ),- child: child,- );- }-final hoverBorder = Border.all(color: style.borderColor,width: style.borderWidth,@@ -158,7 +148,9 @@ class FlowyHoverContainer extends StatelessWidget {margin: style.contentMargin,decoration: BoxDecoration(border: hoverBorder,- color: style.hoverColor ?? Theme.of(context).colorScheme.secondary,+ color: applyStyle+ ? style.hoverColor ?? Theme.of(context).colorScheme.secondary+ : style.backgroundColor,borderRadius: style.borderRadius,),child: Theme(