storeAddress method

  1. @override
Future<void> storeAddress(
  1. Position position,
  2. Map<String, Object?> addressMap
)
override

Attaches addressMap to the stored last known position if it is still position.

Implementation

@override
Future<void> storeAddress(
  Position position,
  Map<String, Object?> addressMap,
) async {
  if (!persist) return;
  final latest = _pendingStore ?? _stored;
  if (latest == null ||
      _pointKey(latest.latitude, latest.longitude) !=
          _pointKey(position.latitude, position.longitude)) {
    return;
  }
  // Attaching writes at once, the pending fix with it.
  _flushStore();
  _storedAddress = Address.fromMap(addressMap);
}