fromMessage method Null safety

MessageSequence fromMessage(
  1. MimeMessage message
)

Convenience method for getting the sequence for a single message's UID or sequence ID.

Implementation

static MessageSequence fromMessage(MimeMessage message) {
  bool isUid;
  int id;
  if (message.uid != null) {
    isUid = true;
    id = message.uid!;
  } else {
    isUid = false;
    id = message.sequenceId!;
  }
  final sequence = MessageSequence(isUidSequence: isUid);
  sequence.add(id);
  return sequence;
}