toMap method

JsonMap toMap()

Converts to a JSON-serializable map.

Implementation

JsonMap toMap() => {
      'onWifi': onWifi.name,
      'onCellular': onCellular.name,
      'onMetered': onMetered.name,
      'onOffline': onOffline.name,
      'onCharging': onCharging.name,
      'batchSize': batchSize,
      'batchIntervalMs': batchInterval.inMilliseconds,
      'lowBatteryThreshold': lowBatteryThreshold,
      'lowBatteryBehavior': lowBatteryBehavior.name,
      'minSyncIntervalMs': minSyncInterval.inMilliseconds,
      if (maxLocationAge != null)
        'maxLocationAgeMs': maxLocationAge!.inMilliseconds,
      'preferWifi': preferWifi,
      'foregroundOnly': foregroundOnly,
    };