Visibility on Flutter Speed Dial Children?

1.4k views Asked by At

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?

1

There are 1 answers

0
Meggy On

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

if (thisid==thatid) SpeedDialChild(...)