isValidDateRange static method
Implementation
static bool isValidDateRange(String fromDate, String toDate) {
try {
final dateFormat = DateFormat('MM-yyyy');
final from = dateFormat.parseStrict(fromDate);
final to = dateFormat.parseStrict(toDate);
return to.isAfter(from) || to.isAtSameMomentAs(from);
} catch (_) {
return false;
}
}