Issue
I have a String, lets say '16:00' and I want to convert it to a TimeOfDay type. I checked the documentation and it only provides a conversor from DateTime to TimeOfDay, but I cant find a way to convert from String to TimeOfDay.
Solution
Try this
TimeOfDay _startTime = TimeOfDay(hour:int.parse(s.split(":")[0]),minute: int.parse(s.split(":")[1]));
This Worked for me..
Answered By - z3r0c00l_2k
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.