Search code examples
flutterflutter-layoutflutter-dependencies

Is there a widget or a library recommended for making this kind of TimePicker?


DatePicker


This is exactly what I want it to look like. But how can I make it? I don't know if I can get this result with a ListView and a ScrollController since I need to be able to loop through the seconds and minutes and I also want it to start at the 00:30 position.


Solution

  • You can try with CupertinoPicker

    Container(
        color: Colors.grey.shade100,
        width: 100,
        height: 200,
        child: CupertinoPicker(
          itemExtent: 48,
          onSelectedItemChanged: (value) {},
          children: List.generate(
            12,
            (index) => Center(
              child: Text(
                index.toString(),
              ),
            ),
          ),
        ),
      ),