0

I'm using the Flutter Speed Dial plugin within a container. I need to toggle the visibility of just one of its children (SpeedDialChild);

child: Container(
            width: 165,
            height:400,
            child:
            SpeedDial(
              overlayOpacity: 0.4,
              icon: Icons.add,
              activeIcon: Icons.expand_less,
              buttonSize: 60.0,
              backgroundColor: Color(0x00000000),
              overlayColor: Color(0x00000000),
              foregroundColor: Colors.white,
              children: [
                SpeedDialChild(
                  child: Icon(Icons.block),
                  backgroundColor: Colors.brown,
                  labelBackgroundColor: Colors.white,
                  label: 'abuse',
                  labelStyle: TextStyle(fontSize: 14.0),
                  onTap: () => print('rude'),
                ),                
                SpeedDialChild(
                    child: Icon(TriangleAll.edit_3),
                    backgroundColor: Colors.deepPurple[200],
                    labelBackgroundColor: Colors.white,
                    label: 'edit',
                    labelStyle: TextStyle(fontSize: 14.0),
                    onTap: () {},                   
                    onLongPress: () {},
                ),
              ],
            ),
          ), 

I tried wrapping the Visibility widget on the icon but then I get a blank white icon where there should be an empty space.

The SpeedDialChild itself can't be wrapped with the Visibility Widget. So I need another option.

Anyone know another way to accomplish this?

Meggy
  • 1,491
  • 3
  • 28
  • 63
  • 1
    Please check [Question 1](https://stackoverflow.com/questions/62355547/visibility-vs-offstage-vs-opacity-which-is-best-in-hiding-a-child-from-widget-t) and [Question 2](https://stackoverflow.com/questions/44489804/show-hide-widgets-in-flutter-programmatically/53044562#53044562), they may help you achieve what you're looking for – Rohan Thacker Jul 05 '21 at 15:49

1 Answers1

0

Here's the answer from the issues queue at Github;

if (thisid==thatid) SpeedDialChild(...)
Peter Haddad
  • 78,874
  • 25
  • 140
  • 134
Meggy
  • 1,491
  • 3
  • 28
  • 63