FaceDetectionResult.fromMap constructor

FaceDetectionResult.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory FaceDetectionResult.fromMap(Map<String, dynamic> map) {
  return FaceDetectionResult(
    // Identity
    id: map['id'] as int?,
    pin: map['pin']?.toString(),
    pinfl: map['pinfl']?.toString(),
    docPinfl: map['docPinfl']?.toString(),
    transactionId: map['transactionId']?.toString(),
    currentPinpp: map['currentPinpp']?.toString(),

    // Document Information
    document: map['document']?.toString(),
    currentDocument: map['currentDocument']?.toString(),
    docSeria: map['docSeria']?.toString(),
    docNumber: map['docNumber']?.toString(),
    documentType: map['documentType']?.toString(),
    dateIssue: map['dateIssue']?.toString(),
    dateExpiry: map['dateExpiry']?.toString(),

    // Names
    name: map['name']?.toString(),
    firstName: map['firstName']?.toString(),
    lastName: map['lastName']?.toString(),
    patronym: map['patronym']?.toString(),
    surname: map['surname']?.toString(),
    givenName: map['givenName']?.toString(),

    // Latin variants
    namelat: map['namelat']?.toString(),
    surnamelat: map['surnamelat']?.toString(),
    patronymlat: map['patronymlat']?.toString(),

    // Cyrillic variants
    namecyr: map['namecyr']?.toString(),
    surnamecyr: map['surnamecyr']?.toString(),
    patronymcyr: map['patronymcyr']?.toString(),

    // English variants
    engname: map['engname']?.toString(),
    engsurname: map['engsurname']?.toString(),
    engpatronym: map['engpatronym']?.toString(),
    patronymEn: map['patronymEn']?.toString(),

    // PINPP variants
    pinpps1: map['pinpps1']?.toString(),
    pinpps2: map['pinpps2']?.toString(),
    pinpps3: map['pinpps3']?.toString(),
    pinpps4: map['pinpps4']?.toString(),

    // Issuing authority
    givePlace: map['givePlace']?.toString(),
    givePlaceName: map['givePlaceName']?.toString(),

    // Birth information
    birthDate: map['birthDate']?.toString(),
    birthPlace: map['birthPlace']?.toString(),
    birthplace: map['birthplace']?.toString(),
    birthCountry: map['birthCountry']?.toString(),
    birthCountryName: map['birthCountryName']?.toString(),
    birthcountry: map['birthcountry']?.toString(),
    birthcountryid: map['birthcountryid']?.toString(),

    // Citizenship and Nationality
    citizenship: map['citizenship']?.toString(),
    citizenshipName: map['citizenshipName']?.toString(),
    citizenshipid: map['citizenshipid']?.toString(),
    nationality: map['nationality']?.toString(),
    nationalityName: map['nationalityName']?.toString(),
    nationalityid: map['nationalityid']?.toString(),

    // Gender and Status
    gender: map['gender'] as int?,
    genderName: map['genderName']?.toString(),
    sex: map['sex']?.toString(),
    subjectState: map['subjectState'] as int?,
    subjectStateName: map['subjectStateName']?.toString(),
    livestatus: map['livestatus']?.toString(),

    // Score
    score: (map['score'] as num?)?.toDouble(),

    // Media
    photo: map['photo']?.toString(),
    signature: map['signature']?.toString(),
    capture: map['capture']?.toString(),

    // Additional Documents
    documents: (map['documents'] as List<dynamic>?)
        ?.map((e) => DocumentInfo.fromMap(e as Map<String, dynamic>))
        .toList(),
    foreignDocuments: (map['foreignDocuments'] as List<dynamic>?)
        ?.map((e) => ForeignDocument.fromMap(e as Map<String, dynamic>))
        .toList(),

    // Nested format fields
    juralTypeId: map['juralTypeId'] as int?,
    customerProfileId: map['customerProfileId'] as int?,
    languageId: map['languageId'] as int?,
    personalData: map['personalData'] != null
        ? PersonalData.fromMap(map['personalData'] as Map<String, dynamic>)
        : null,
    attributes: (map['attributes'] as List<dynamic>?)
        ?.map((e) => Attribute.fromMap(e as Map<String, dynamic>))
        .toList(),
    customerFiles: map['customer_files'] != null
        ? CustomerFiles.fromMap(map['customer_files'] as Map<String, dynamic>)
        : null,
    isExternalData: map['is_external_data'] as bool?,
  );
}