isImage method
Implementation
bool isImage() {
RegExp pattern = RegExp(r'IMG-\d\d\d\d\d\d\d\d-WA\d\d\d\d\d?\d?[.]jpg');
if (dateTime != null && msg != null) {
String dateTimeString = dateTime!.year.toString() +
FixDateUtilities.fixMonthOrDayTo01(dateTime!.month.toString()) +
FixDateUtilities.fixMonthOrDayTo01(dateTime!.day.toString());
return msg!.startsWith("IMG-$dateTimeString-WA") &&
msg!.startsWith(pattern);
} else if (msg != null) {
return msg!.startsWith(pattern);
}
return false;
}