textScrollPicker method

Widget textScrollPicker(
  1. BuildContext context,
  2. List<String> elements,
  3. dynamic onSelected(
    1. String value
    ), {
  4. double pickerHeight = 180,
})

Implementation

Widget textScrollPicker(BuildContext context, List<String> elements,
    Function(String value) onSelected,
    {double pickerHeight = 180}) {
  return SizedBox(
    height: pickerHeight,
    child: Row(children: [
      Expanded(
          child: CupertinoPicker(
        onSelectedItemChanged: (int value) {
          onSelected(elements[value]);
        },
        itemExtent: 48,
        children: List.generate(elements.length, (index) {
          return SizedBox(
            height: 48,
            child: Center(
              child: DUI.text.title3(context, elements[index]),
            ),
          );
        }),
      ))
    ]),
  );
}