Make selectable only one button in flutter

Viewed 29

help me please, i tried with toggle button, but its icon(buttons) are attached together, i cant round middle butoon. How can i do like in the picture.Thank youenter image description here

return ToggleButtons(
     selectedColor: Colors.white,
     renderBorder: false,
       isSelected: iSselected,
       fillColor: Colors.orange,
     onPressed: (int newIndex) {
     setState(() {
     for(int index = 0; index < iSselected.length; index++){
       if(index == newIndex){
         iSselected[index] = true;
       } else{
         iSselected[index] = false;
       }
     }
     });
   },
     children: [
           CustomIcon(
             radius: BorderRadius.circular(32.0),
             isSelected: iSselected[0],
             icon: const Icon(MyFlutterApp.mobile),
           ),
           CustomIcon(
               radius: BorderRadius.circular(32.0),
               isSelected: iSselected[1],
              icon: const Icon(Icons.computer)
          ),
           CustomIcon(
               radius: BorderRadius.circular(32.0),
               isSelected: iSselected[2],
           icon: const Icon(Icons.monitor_heart)
       ),
           CustomIcon(
               radius: BorderRadius.circular(32.0),
               isSelected: iSselected[3],
           icon: const Icon(Icons.collections_bookmark_sharp)
       )
     ]
   );
  }
}
0 Answers
Related