Want to convert flutter TimeOfDay to DateTime? This is not possible. TimeOfDay holds only the hour and minute. While a DateTime also has day/month/year
If you want to convert it, you will need more informations. Such as the current DateTime. And then merge the two into one final datetime.
final now = new DateTime.now();
return new DateTime(now.year, now.month, now.day, t.hour, t.minute);
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.