How to take out the padding of the CupertinoPicker?

931 Views Asked by At

I have two CupertinoPicker and a i need to take out the gap that it has between then,anyone have an idea please ? enter image description here

 Center(
        child: Row(
          children: [
            SizedBox(
                height: 200,
                width: 100,
                child: CupertinoPicker(
                    itemExtent: 20,
                    onSelectedItemChanged: (index) => setState(() {
                          this.index == index;
                        }),
                    children: definingHoursList())),
            SizedBox(
                height: 200,
                width: 100,
                child: CupertinoPicker(
                    itemExtent: 20,
                    onSelectedItemChanged: (index) => setState(() {
                          this.index == index;
                        }),
                    children: definingHoursList()))
          ],
        ),
      ),
1

There are 1 best solutions below

0
On BEST ANSWER

Take a look at the documentation for the CupertinoPickerDefaultSelectionOverlay class.

By passing it to CupertinoPicker you can disable the margin, but it'll also lose the rounded corners.

  CupertinoPicker(
    selectionOverlay: const CupertinoPickerDefaultSelectionOverlay(
      capStartEdge: false,
      capEndEdge: false, 
    ),
    // other parameters,
  )