getCurrentDate function
getCurrentDate method this method will get current date in format provided.
Implementation
String getCurrentDate({String? newDateTimeFormat}) {
if (newDateTimeFormat != null && newDateTimeFormat.isNotEmpty) {
return DateFormat(newDateTimeFormat).format(DateTime.now());
} else {
return DateFormat(kDefaultDateTimeFormat).format(DateTime.now());
}
}