floating_panel icon indicating copy to clipboard operation
floating_panel copied to clipboard

The icons remain visible even when the panel is closed

Open LUK3D opened this issue 3 years ago • 2 comments

LUK3D avatar Mar 13 '21 06:03 LUK3D

same issue, seems it's not fixed

madura7 avatar Jun 12 '21 05:06 madura7

the problem is this line is forced to true https://github.com/akshayejh/floating_panel/blob/c109783699ca4979adfbc6778c28189d483103a3/lib/floatingpanel.dart#L314

to simply fix this, you can change it to visible: _panelState == PanelState.open,

for me, I also modified Visibility to AnimatedOpacity

AnimatedOpacity(
  duration: Duration(
      milliseconds: _panelState == PanelState.open
          ? widget.panelAnimDuration ?? 400
          : 0),
  opacity: _panelState == PanelState.open ? 1 : 0,
  child: Container(
    child: Column(
      children: List.generate(_buttons.length, (index) {
        return GestureDetector(
          onTap: () {
            widget.onPressed(index);
          },
          child: _FloatButton(
            size: widget.size ?? 70.0,
            icon: _buttons[index],
            color: widget.contentColor ?? Colors.white,
            iconSize: widget.iconSize ?? 24.0,
          ),
        );
      }),
    ),
  ),
),

Tataro avatar Jul 04 '21 11:07 Tataro