time_picker_widget 1.0.0+10 copy "time_picker_widget: ^1.0.0+10" to clipboard
time_picker_widget: ^1.0.0+10 copied to clipboard

It is a custom showTimePicker to allow you set a selectableTimePredicate like you do in showDatePicker.

time_picker_widget #

It is a custom showTimePicker to allow you set a selectableTimePredicate like you do in showDatePicker.

showCustomTimePicker(
    context: context,
    // It is a must if you provide selectableTimePredicate
    onFailValidation: (context) => print('Unavailable selection'),
    initialTime: TimeOfDay(hour: 2, minute: 0),
    selectableTimePredicate: (time) =>
        time.hour > 1 &&
        time.hour < 14 &&
        time.minute % 10 == 0).then((time) =>
    setState(() => selectedTime = time?.format(context)))

DEMO

You can see a complete sample in example/example.dart file

29
likes
90
pub points
91%
popularity

Publisher

unverified uploader

It is a custom showTimePicker to allow you set a selectableTimePredicate like you do in showDatePicker.

Repository (GitLab)
View/report issues

Documentation

API reference

License

Unlicense (LICENSE)

Dependencies

flutter

More

Packages that depend on time_picker_widget