Skip to content
pubscout

flutter_background_geolocation

5.9.2, released 3 weeks ago by transistorsoft.com

Background location tracking and geofencing for iOS and Android

WASM-readyRock solid
$ flutter pub add flutter_background_geolocation
Source repository

What it does

Provides continuous background location updates and geofencing with motion‑detection to conserve battery. It exposes a simple API for configuring distance filters, event callbacks, and geofence management.

AI-written summary of version 5.9.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • Need reliable background location updates on both iOS and Android
  • Require geofencing with automatic start/stop based on device motion
  • Want battery‑conscious tracking that pauses when stationary

Skip it when

  • Only need foreground location or simple one‑shot location requests
  • You cannot afford a paid license for release builds

Strengths

  • Battery‑conscious motion detection
  • Cross‑platform (iOS & Android) with a single API
  • Built‑in geofence management and event handling

Weaknesses

  • Requires a paid license for release builds
  • Plugin size and native dependencies may increase app size
  • Setup requires platform‑specific permissions and configuration

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Add Android permissions (ACCESS_FINE_LOCATION, ACCESS_BACKGROUND_LOCATION) and iOS plist entries (NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription). Include the license key in the AndroidManifest or iOS Info.plist. No build_runner needed.

import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;

void init() async {
  await bg.BackgroundGeolocation.ready(bg.Config(
    desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,
    distanceFilter: 50,
    stopOnTerminate: false,
    startOnBoot: true,
  ));
  bg.BackgroundGeolocation.onLocation((bg.Location location) {
    print('Location: $location');
  });
  bg.BackgroundGeolocation.start();
}

Alternatives

Packages that do the same job and could replace flutter_background_geolocation.

  • geolocator

    Provides basic foreground/background location but no geofencing or motion detection

  • location

    Simple location API for both platforms but lacks geofencing and advanced background features

Works with

Packages commonly used together with flutter_background_geolocation: ones it builds on, ones built on it, and its own family.