Flutter ListWheelScrollView , How to add horizontal lines

Viewed 707

This is flutter_datetime_picker's UI. How to add horizontal lines like this:

enter image description here

This is my code and UI.

ListWheelScrollView(
  itemExtent: 20,
  diameterRatio: 0.9,
  perspective: 0.003,
  controller: dayScrollController,
  physics: FixedExtentScrollPhysics(
    parent: BouncingScrollPhysics(),
  ),
  children: dayList.map((item) {
    return Container(
      height: 20,
      alignment: Alignment.center,
      child: Container(
        child: Text(
          '$item',
          style: TextStyle(
            color: dayList.indexOf(item) != dayIndex ? Colors.grey : Colors.black,
            fontSize: 20
          ),
        ),
      )
    );
  }).toList(),
  onSelectedItemChanged: (index) {
    setState(() {
      dayIndex = index;
    });
  },
),

enter image description here

2 Answers

try adding these two lines as properties under ListWheelScrollView:

useMagnifier: true,
magnification: 1.2,

or use CupertinoPicker

Related