dayToInt function Null safety

int dayToInt(
  1. Day? day
)

Implementation

int dayToInt(Day? day) => day == null ? -1 : Day.values.indexOf(day);