ResponseModel.fromMap constructor
get ResponseModel from map
.
Implementation
factory ResponseModel.fromMap(Map<String, dynamic> map) {
final code = map['Response']['ResponseCode'];
return ResponseModel(
header: HeaderModel.fromMap(map['Header']),
responseCode: code is int ? code : int.tryParse(code) ?? 0,
responseMsg: map['Response']['ResponseMsg'] ?? '',
scannedData: map['Detail']?['ScannedData'] ?? '',
rawResponse: json.encode(map),
);
}