AndroidLocationOptions.fromMap constructor

AndroidLocationOptions.fromMap(
  1. Map map
)

Creates options from a serialized map.

Implementation

factory AndroidLocationOptions.fromMap(Map<dynamic, dynamic> map) {
  return AndroidLocationOptions(
    updateIntervalMs: (map['updateIntervalMs'] as num?)?.toInt() ?? 1000,
    fastestIntervalMs: (map['fastestIntervalMs'] as num?)?.toInt() ?? 500,
    maxWaitTimeMs: (map['maxWaitTimeMs'] as num?)?.toInt(),
    foregroundServiceType:
        map['foregroundServiceType'] as String? ?? 'location',
    notificationChannelId:
        map['notificationChannelId'] as String? ?? 'nexora_location',
    notificationTitle:
        map['notificationTitle'] as String? ?? 'Location active',
    notificationText:
        map['notificationText'] as String? ?? 'Nexora SDK is using location.',
    geofenceDwellMs: (map['geofenceDwellMs'] as num?)?.toInt(),
    geofenceInitialTrigger:
        map['geofenceInitialTrigger'] as String? ?? 'enter',
  );
}