buildList method

Widget buildList(
  1. dynamic context,
  2. int position,
  3. List<FixedExtentScrollController> controllers
)

Implementation

Widget buildList(context, int position, List<FixedExtentScrollController> controllers) {
  var maxWidth = MediaQuery.of(context).size.width;
  return MediaQuery.removePadding(
      context: context,
      removeTop: true,
      child: ScrollConfiguration(
        behavior: NoWaveBehavior(),
        child: ListWheelScrollView.useDelegate(
            itemExtent: pickerHeight / pickerItemCount,
            diameterRatio: 100,
            controller: controllers[position],
            physics: const FixedExtentScrollPhysics(),
            childDelegate: ListWheelChildBuilderDelegate(
                childCount: data[position].length,
                builder: (context, index) {
                  return Container(
                      alignment: Alignment.center,
                      height: pickerHeight / pickerItemCount,
                      width: maxWidth,
                      child: TDItemWidget(
                        index: index,
                        itemHeight: pickerHeight / pickerItemCount,
                        content: data[position][index],
                        itemDistanceCalculator: itemDistanceCalculator,
                        fixedExtentScrollController: controllers[position],
                      ));
                })),
      ));
}