messages static method

String messages({
  1. ErrorResponseModel? errorResponse,
})

Implementation

static String messages({ ErrorResponseModel? errorResponse}){
  String msg ='';
  if( errorResponse != null ) {
    msg = errorResponse.title.tr;
    if( errorResponse.errors!=null && errorResponse.errors!.isNotEmpty) {
      errorResponse.errors!.forEach((field, messages) {
        msg += '\n\n\t - $field:';
        if( messages.isNotEmpty) {
          for (var message in messages) {
            msg += '\n\t\t    $message';
          }
        }
      });
    }
  }
  return msg;
}