isValidDateRange static method
Implementation
static bool isValidDateRange({required String fromDate, required 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;
}
}