getMatch method

OcrMrzDocumentType? getMatch([
  1. ConstData? data
])

Implementation

OcrMrzDocumentType? getMatch([ConstData? data]) {
  data ??= ConstData.offline();
  String? dc = docCode;
  OcrMrzDocumentType? match;
  if (dc != null && dc.length > 1) {
    match = data!.documentType.lastOrNullWhere((a) => a.type == data!.documentCode.firstWhere((a) => a.type == shortType || a.code == documentCode?.code).type);
  }
  match ??=  data!.documentType.lastOrNullWhere((a) => a.type == shortType);
  // log("match of $dc  - ${shortType}=> ${match?.title}");
  return match;
}