SignificantChangeConfig.fromMap constructor

SignificantChangeConfig.fromMap(
  1. JsonMap map
)

Creates from a map.

Implementation

factory SignificantChangeConfig.fromMap(JsonMap map) {
  return SignificantChangeConfig(
    minDisplacementMeters:
        (map['minDisplacementMeters'] as num?)?.toDouble() ?? 500,
    deferUntilMoved: map['deferUntilMoved'] as bool? ?? true,
    wakeFromBackground: map['wakeFromBackground'] as bool? ?? true,
    monitorInForeground: map['monitorInForeground'] as bool? ?? false,
    maxUpdateInterval: map['maxUpdateIntervalMs'] != null
        ? Duration(milliseconds: (map['maxUpdateIntervalMs'] as num).toInt())
        : null,
  );
}