tryParse static method
Implementation
static MessageStatus? tryParse(String? value) {
final status = value?.trim().toLowerCase();
if (status?.isEmpty ?? true) return null;
if (status == read.name) {
return read;
} else if (status == delivered.name) {
return delivered;
} else if (status == undelivered.name) {
return undelivered;
} else if (status == pending.name) {
return pending;
}
return null;
}