title: Convert string datetime to DateTime type in flutter
body: <p>I want to combine date and time to DateTime format. so that I can use it to send local notifications.
  I am getting time and date separately from firebase as appointment_date and appointment_time:</p>
  <p><a href="https://i.stack.imgur.com/2PkPZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2PkPZ.png" alt="enter image description here" /></a></p>
  <p>using this code:</p>
  <pre><code>for (int i = 0; i &lt; appt_list.length; i++) {
            
              String name = appt_list[i].docName;
              String k = appt_list[i].key;
              Provider.of&lt;NotificationService&gt;(context, listen: false)
                  .sheduledNotification(datetime, name, k);
            }
  </code></pre>
  <p>and i want to use custom (values stored in firebase for appointments reminder) timedate in local notification function like using 'scheduledNotificationDateTime' variable is doing:</p>
  <pre><code>Future sheduleddateNotification(DateTime datetime, String name, String key) async {
      var scheduledNotificationDateTime = DateTime.now().add(Duration(seconds: 5));
      var androidPlatformChannelSpecifics =
      AndroidNotificationDetails(key,
          'your other channel name', 'your other channel description');
      var iOSPlatformChannelSpecifics =
      IOSNotificationDetails();
      NotificationDetails platformChannelSpecifics = NotificationDetails(
          androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
      await _flutterLocalNotificationsPlugin.schedule(
          0,
          'Reminder Appointment',
          'You have an appointment scheduled with $name at ${(time.hour)}:${(time.minute)}',
          scheduledNotificationDateTime,
          platformChannelSpecifics);
    }
  </code></pre>
  <p>But I don't know how do I combine my date and time together and use them as one! Please help me out in solving this problem</p>