flutter create datetime from string code example
Example 1: dart convert string to datetime
var dateTime = DateTime.parse("dateTimeString");
Example 2: flutter date time to timestamp
DateTime currentPhoneDate = DateTime.now();
Timestamp myTimeStamp = Timestamp.fromDate(currentPhoneDate);
DateTime myDateTime = myTimeStamp.toDate();
print("current phone data is: $currentPhoneDate");
print("current phone data is: $myDateTime");
Example 3: string to timeofday flutter
TimeOfDay _startTime = TimeOfDay(hour:int.parse(s.split(":")[0]),minute: int.parse(s.split(":")[1]));