i am using showTimePicker
widget to pick time, when i select the time , it prints it like this 7:10 PM
but i want to add seconds too, it should be like 7:10:00 PM
seconds can be default 00
.
here is my code where i am creating this
TextField(
decoration: InputDecoration(labelText: timein,hintText: "Time in",icon: Icon(Icons.timer)),
controller:timeinController ,
readOnly:true,
onTap: () async {
TimeOfDay pickedTime = await showTimePicker(
initialTime: TimeOfDay.now(),
context: context,
);
if(pickedTime != null ){
print(pickedTime.format(context)); //output 7:10 PM
setState(() {
timeinController.text = pickedTime.format(context); //set the value of text field.
});
}else{
print("Time is not selected");
}
},
),
here showtimepicker looks like
please help how to do this.