Transfor String to DateTime
DateTime? toDate({required String format}) { if (isNotNullOrEmpty) { return DateFormat(format).parse(this); } else { return null; } }