ResponseStatus.fromSat constructor

ResponseStatus.fromSat(
  1. List<String?> consulta
)

Implementation

factory ResponseStatus.fromSat(List<String?> consulta) {
  final consultaMap = consulta.asMap();
  final status = ResponseStatus(
    numeroSessao: consulta[0] ?? '',
    codStatus: consulta[1] ?? '',
    mensagem: consulta[2] ?? '',
    cod: consulta[3] ?? '',
    mensagemSefaz: consultaMap.containsKey(4) ? consulta[4]! : '',
    nserieSat: consultaMap.containsKey(5) ? consulta[5]! : '',
    tipoLan: consultaMap.containsKey(6) ? consulta[6]! : '',
    lanIp: consultaMap.containsKey(7) ? consulta[7]! : '',
    lanMac: consultaMap.containsKey(8) ? consulta[8]! : '',
    lanMask: consultaMap.containsKey(9) ? consulta[9]! : '',
    lanGateway: consultaMap.containsKey(10) ? consulta[10]! : '',
    lanDns: consultaMap.containsKey(11) ? consulta[11]! : '',
    lanDns2: consultaMap.containsKey(12) ? consulta[12]! : '',
    statusLan: consultaMap.containsKey(13) ? consulta[13]! : '',
    nivelBateria: consultaMap.containsKey(14) ? consulta[14]! : '',
    memoriaTotal: consultaMap.containsKey(15) ? consulta[15]! : '',
    memoriaUsada: consultaMap.containsKey(16) ? consulta[16]! : '',
    dataAtual: consultaMap.containsKey(17) ? consulta[17]! : '',
    versaoSoftwareSat: consultaMap.containsKey(18) ? consulta[18]! : '',
    versaoLayout: consultaMap.containsKey(19) ? consulta[19]! : '',
    ultimoCfe: consultaMap.containsKey(20) ? consulta[20]! : '',
    numeroInicial: consultaMap.containsKey(21) ? consulta[21]! : '',
    numeroFinal: consultaMap.containsKey(22) ? consulta[22]! : '',
    dataUltimaCfe: consultaMap.containsKey(23) ? consulta[23]! : '',
    dataComunicacaoSefaz: consultaMap.containsKey(24) ? consulta[24]! : '',
    dataEmissaoCertificado: consultaMap.containsKey(25) ? consulta[25]! : '',
    dataVencimentoCertificado:
        consultaMap.containsKey(26) ? consulta[26]! : '',
    estadoSat: consultaMap.containsKey(27) ? consulta[27]! : '',
  );

  return status;
}