toDateRange function Null safety

List<DateTime> toDateRange(
  1. String stringValue
)

Implementation

List<DateTime> toDateRange(String stringValue) {
  final arr = json.decode(stringValue);
  return [DateTime.parse(arr[0] as String), DateTime.parse(arr[1] as String)];
}