toMapQuery method

Map<String, dynamic> toMapQuery()

Implementation

Map<String, dynamic> toMapQuery(){
  final fieldMap = _fieldMap();
  final json = toMap();
  for(String key in json.keys){
    final val = json[key];
    if(val is NUIEnt){
      json[key] = jsonEncode(val);
    }
    if(val is Map){
      json[key] = jsonEncode(val);
    }
    if(val is List<NUIEnt>){
      json[key] = jsonEncode(val);
    }
    if(val is List){
      json[key] = jsonEncode(val);
    }
    if(val is DateTime){
      final field = fieldMap[key];
      if(field.additionalFormat != null){
        json[key] = dateToString(val, format: field.additionalFormat);
      }
      else {
        json[key] = dateToString(val);
      }
    }
  }
  return json;
}