getPrevMonth method

String getPrevMonth(
  1. int currentMonth
)

Implementation

String getPrevMonth(int currentMonth) {
  /// Enter the month and get the previous month

  int finalMnth = currentMonth - 1;
  if (finalMnth < 10) {
    return "0$finalMnth";
  } else {
    return finalMnth.toString();
  }
}