ItemAlreadyExistException.fromMap constructor

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

Implementation

factory ItemAlreadyExistException.fromMap(Map<String, dynamic> map){
  if(map['errCode'] == null
     || map['errCode'] is! int
     || map['errCode'] != InteractivePlusSystemExceptionType.ITEM_ALREADY_EXIST_EXCEPTION.errCode
  ){
    throw InteractivePlusSystemException.SERIALIZATION_EXCEPTION;
  }
  String Function([String? locale])? errMessageDecoded;
  if(map['errMessage'] != null && map['errMessage'] is String){
    errMessageDecoded = ([locale]) => map['errMessage'];
  }
  SingleItemRelatedParams? errParamDecoded;
  if(map['errParams'] != null && map['errParams'] is Map<String,dynamic>){
    try{
      errParamDecoded = SingleItemRelatedParams.fromMap(map['errParams']);
    }catch(e){
      errParamDecoded = null;
    }
  }
  return ItemAlreadyExistException(errMessageDecoded,errParamDecoded);
}