textScrollPicker method
Widget
textScrollPicker(
- BuildContext context,
- List<
String> elements, - dynamic onSelected(
- String value
- 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]),
),
);
}),
))
]),
);
}