title: Flutter How can i save my date in Share preferences
body: <p>I want to save my date thats picked from a DateTime-picker in a shared preferences so it will also be showen after restart the app </p>
  
  <pre><code>child: InkWell(
                        onTap: (){
                          DatePicker.showDateTimePicker(context,
                          showTitleActions: true,
                          minTime: DateTime.now().toLocal(),
                          onConfirm: (date){
                            setState(() {
                              _dateTime = date;
  
                            });
                          },
                          currentTime: DateTime.now().toLocal(),
                          locale: LocaleType.de
                          );
                        },
                        child: Text(
                          (_dateTime == null ? 'Wählen sie Ihren nächsten Termin' : DateFormat("dd-MM-yyyy hh:mm").format(_dateTime)),
                          style: TextStyle(
                            fontSize: data.size.height / 29,
                            color: Colors.grey[400],
                          ),
                        ),
                      ),
  </code></pre>