SyncCollectionConfig<T extends dynamic> constructor

SyncCollectionConfig<T extends dynamic>({
  1. required dynamic results,
  2. required String collectionName,
  3. required String idSelector(
    1. dynamic model
    ),
  4. required bool needsSync(
    1. dynamic model
    ),
  5. Map<String, dynamic> toSyncMap(
    1. dynamic model
    )?,
  6. dynamic fromServerMap(
    1. Map<String, dynamic> serverMap
    )?,
  7. List<String>? propertyNames,
  8. Map<String, List<String>>? embeddedProperties,
  9. Map<String, dynamic Function(Map<String, dynamic>)>? embeddedCreators,
  10. T create()?,
  11. void applyAckSuccess(
    1. dynamic model
    )?,
  12. void applyNoDiff(
    1. dynamic model
    )?,
  13. Map<String, dynamic> sanitize(
    1. Map<String, dynamic>
    )?,
  14. Map<String, dynamic> emitPreProcessor(
    1. Map<String, dynamic> rawJson
    )?,
  15. dynamic decode(
    1. Map<String, dynamic> data
    )?,
})

Implementation

SyncCollectionConfig({
  required this.results,
  required this.collectionName,
  required this.idSelector,
  required this.needsSync,
  this.toSyncMap,
  this.fromServerMap,
  this.propertyNames,
  this.embeddedProperties,
  this.embeddedCreators,
  this.create,
  this.applyAckSuccess,
  this.applyNoDiff,
  this.sanitize,
  this.emitPreProcessor,
  RealmObject Function(Map<String, dynamic> data)? decode,
}) : decode = decode ?? ((Map<String, dynamic> map) {
        if (fromServerMap != null) {
          return fromServerMap(map);
        }
        return RealmJson.fromEJsonMap<T>(
          map,
          create: create,
          propertyNames: propertyNames,
          embeddedCreators: embeddedCreators,
        );
      });