here I want to validate time. as per this image, when I choose the Shift Begin time and End Time then whenever I am choosing break time it will always between Shift begin time and Shift end time.
Here is the Image of output
Here is the code for the time picker
DateTimeField(
decoration: InputDecoration(
contentPadding: const EdgeInsets.symmetric(
vertical: 15.0, horizontal: 10),
labelText: "Time",
filled: true,
fillColor: Colors.white,
border: OutlineInputBorder(
borderRadius: new BorderRadius.circular(6),
),
),
format: format,
onShowPicker: (context, currentValue) async {
final time = await showTimePicker(
context: context,
initialTime: TimeOfDay.fromDateTime(
currentValue ?? DateTime.now(),
),
);
return DateTimeField.convert(time);
},
),