CheckCurrenDate method

dynamic CheckCurrenDate(
  1. String day
)

Implementation

CheckCurrenDate(String day) {
  String findMonth = DateFormat('MMM').format(currentDate);
  String findYear = DateFormat('yyyy').format(currentDate);
  String findDate = DateFormat('dd').format(currentDate);
  return currentYear == findYear &&
          currentMonth == findMonth &&
          day == findDate
      ? Card(
          color: Color(0xff0074B7),
          shape:
              RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
          elevation: 0,
          child: Padding(
            padding: EdgeInsets.all(5),
            child: Text(
              day,
              textAlign: TextAlign.center,
              style: const TextStyle(
                  color: Colors.white,
                  fontWeight: FontWeight.w700,
                  fontSize: 14),
            ),
          ),
        )
      : Padding(
          padding: EdgeInsets.all(5),
          child: Text(
            day,
            textAlign: TextAlign.center,
            style: TextStyle(
                color:
                    day.isEmpty ? Colors.black : TextDayColor(int.parse(day)),
                fontWeight: FontWeight.w700,
                fontSize: 14),
          ));
}