getTime static method

String getTime({
  1. bool amPm = false,
})

Implementation

static String getTime({bool amPm = false}) {
  DateFormat dateFormat =
      amPm ? DateFormat("HH:mm a") : DateFormat("HH:mm:ss");
  String currentDateTime = dateFormat.format(DateTime.now());
  return currentDateTime;
}