diff --git a/lib/pages/spaces_management/widgets/hoverable_button.dart b/lib/pages/spaces_management/widgets/hoverable_button.dart index 0c158c12..0880471a 100644 --- a/lib/pages/spaces_management/widgets/hoverable_button.dart +++ b/lib/pages/spaces_management/widgets/hoverable_button.dart @@ -24,37 +24,40 @@ class _HoverableButtonState extends State { @override Widget build(BuildContext context) { final theme = Theme.of(context); + final screenWidth = MediaQuery.of(context).size.width; return GestureDetector( onTap: widget.onTap, child: MouseRegion( - onEnter: (_) => _updateHoverState(true), - onExit: (_) => _updateHoverState(false), - child: AnimatedContainer( - duration: const Duration(milliseconds: 200), - padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 8), - decoration: BoxDecoration( - color: isHovered ? ColorsManager.warningRed : Colors.white, - borderRadius: BorderRadius.circular(16), - boxShadow: [ - if (isHovered) - BoxShadow( - color: ColorsManager.warningRed.withOpacity(0.4), - blurRadius: 8, - offset: const Offset(0, 4), + onEnter: (_) => _updateHoverState(true), + onExit: (_) => _updateHoverState(false), + child: SizedBox( + width: screenWidth * .07, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 8), + decoration: BoxDecoration( + color: isHovered ? ColorsManager.warningRed : Colors.white, + borderRadius: BorderRadius.circular(16), + boxShadow: [ + if (isHovered) + BoxShadow( + color: ColorsManager.warningRed.withOpacity(0.4), + blurRadius: 8, + offset: const Offset(0, 4), + ), + ], ), - ], - ), - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - _buildIcon(), - if (!isHovered) const SizedBox(width: 8), - if (!isHovered) _buildText(theme), - ], - ), - ), - ), + child: Center( + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + _buildIcon(), + if (!isHovered) const SizedBox(width: 8), + if (!isHovered) _buildText(theme), + ], + ), + )), + )), ); }