getPartWithMediaSubtype method

  1. @override
MimePart? getPartWithMediaSubtype(
  1. MediaSubtype subtype
)
override

Searches the MimePart with the specified subtype.

Implementation

@override
MimePart? getPartWithMediaSubtype(MediaSubtype subtype) {
  var match = super.getPartWithMediaSubtype(subtype);
  if (match == null) {
    final partsByFetchId = _individualParts;
    if (partsByFetchId != null) {
      match = partsByFetchId.values
          .firstWhereOrNull((p) => p.mediaType.sub == subtype);
    }
  }
  return match;
}