watch method

  1. @override
Stream<LocationResult> watch({
  1. LocationProfile? profile,
  2. bool withAddress = false,
  3. bool handlePermission = true,
  4. bool handleServices = true,
  5. LocationAccuracy? accuracy,
  6. Locale? locale,
  7. BuildContext? context,
  8. BackgroundLocation? background,
})
override

Runs the same setup as get once, then streams results. A setup failure is emitted as one failed result, and the stream closes.

With withAddress, the address is looked up again only after moving GeocodingConfig.watchRegeocodeMeters or after watchRegeocodeTtl; a result is emitted again when it arrives.

background keeps it running in the background; see BackgroundLocation.

Implementation

@override
Stream<LocationResult> watch({
  LocationProfile? profile,
  bool withAddress = false,
  bool handlePermission = true,
  bool handleServices = true,
  LocationAccuracy? accuracy,
  Locale? locale,
  BuildContext? context,
  BackgroundLocation? background,
}) => _record(
  'watch',
  {
    'profile': profile,
    'withAddress': withAddress,
    'handlePermission': handlePermission,
    'handleServices': handleServices,
    'accuracy': accuracy,
    'locale': locale,
    'background': background,
  },
  () => _impl.watch(
    profile: profile,
    withAddress: withAddress,
    handlePermission: handlePermission,
    handleServices: handleServices,
    accuracy: accuracy,
    locale: locale,
    context: context,
    background: background,
  ),
);