getDateTime method
Implementation
DateTime? getDateTime({required String key, dynamic defaultValue}) {
dynamic value = getData(key: key);
if (value == null) {
return defaultValue;
}
if (value is String) {
return DateTime.parse(value);
}
if (value is int) {
return DateTime.fromMillisecondsSinceEpoch(value);
}
return defaultValue;
}