{"id":13513773,"url":"https://github.com/transistorsoft/flutter_background_geolocation","last_synced_at":"2025-03-31T02:33:03.042Z","repository":{"id":37269730,"uuid":"139649785","full_name":"transistorsoft/flutter_background_geolocation","owner":"transistorsoft","description":"Sophisticated, battery-conscious background-geolocation \u0026 geofencing with motion-detection","archived":false,"fork":false,"pushed_at":"2025-03-24T12:41:35.000Z","size":793413,"stargazers_count":667,"open_issues_count":23,"forks_count":252,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-03-24T13:36:29.025Z","etag":null,"topics":["background","background-geolocation","background-location","flutter","location","location-tracking"],"latest_commit_sha":null,"homepage":"https://www.transistorsoft.com/shop/products/flutter-background-geolocation","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transistorsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-04T00:32:58.000Z","updated_at":"2025-03-24T12:41:38.000Z","dependencies_parsed_at":"2023-10-04T19:24:45.431Z","dependency_job_id":"67d6427b-f578-4782-83ef-2a4e332609cd","html_url":"https://github.com/transistorsoft/flutter_background_geolocation","commit_stats":{"total_commits":405,"total_committers":15,"mean_commits":27.0,"dds":0.2592592592592593,"last_synced_commit":"fea438a3b250b767234a071d3f2caa0dba14b5b0"},"previous_names":[],"tags_count":122,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fflutter_background_geolocation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fflutter_background_geolocation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fflutter_background_geolocation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transistorsoft%2Fflutter_background_geolocation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transistorsoft","download_url":"https://codeload.github.com/transistorsoft/flutter_background_geolocation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246407399,"owners_count":20772126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background","background-geolocation","background-location","flutter","location","location-tracking"],"created_at":"2024-08-01T05:00:37.473Z","updated_at":"2025-03-31T02:32:58.032Z","avatar_url":"https://github.com/transistorsoft.png","language":"Dart","funding_links":[],"categories":["Dart"],"sub_categories":[],"readme":"# flutter_background_geolocation\n\n[![](https://dl.dropboxusercontent.com/s/nm4s5ltlug63vv8/logo-150-print.png?dl=1)](https://www.transistorsoft.com)\n\n-------------------------------------------------------------------------------\n\nThe *most* sophisticated background **location-tracking \u0026 geofencing** module with battery-conscious motion-detection intelligence for **iOS** and **Android**.\n\nThe plugin's [Philosophy of Operation](https://github.com/transistorsoft/flutter_background_geolocation/wiki/Philosophy-of-Operation) is to use **motion-detection** APIs (using accelerometer, gyroscope and magnetometer) to detect when the device is *moving* and *stationary*.\n\n- When the device is detected to be **moving**, the plugin will *automatically* start recording a location according to the configured `distanceFilter` (meters).\n\n- When the device is detected be **stationary**, the plugin will automatically turn off location-services to conserve energy.\n\nAlso available for [Cordova](https://github.com/transistorsoft/cordova-background-geolocation-lt), [React Native](https://github.com/transistorsoft/react-native-background-geolocation), [NativeScript](https://github.com/transistorsoft/nativescript-background-geolocation-lt) and [pure native](https://github.com/transistorsoft/background-geolocation-lt) apps.\n\n----------------------------------------------------------------------------\n\nThe **[Android module](https://www.transistorsoft.com/shop/products/flutter-background-geolocation)** requires [purchasing a license](https://www.transistorsoft.com/shop/products/flutter-background-geolocation).  However, it *will* work for **DEBUG** builds.  It will **not** work with **RELEASE** builds [without purchasing a license](https://www.transistorsoft.com/shop/products/flutter-background-geolocation).\n\n(2018) This plugin is supported **full-time** and field-tested **daily** since 2013.\n\n----------------------------------------------------------------------------\n\n[![Google Play](https://dl.dropboxusercontent.com/s/80rf906x0fheb26/google-play-icon.png?dl=1)](https://play.google.com/store/apps/details?id=com.transistorsoft.flutterbackgroundgeolocationexample)\n\n![Home](https://dl.dropboxusercontent.com/s/wa43w1n3xhkjn0i/home-framed-350.png?dl=1)\n![Settings](https://dl.dropboxusercontent.com/s/8oad228siog49kt/settings-framed-350.png?dl=1)\n\n# Contents\n- ### 📚 [API Documentation](https://pub.dartlang.org/documentation/flutter_background_geolocation/latest/flt_background_geolocation/flt_background_geolocation-library.html)\n- ### [Installing the Plugin](#-installing-the-plugin)\n- ### [Setup Guides](#-setup-guides)\n- ### [Using the plugin](#-using-the-plugin)\n- ### [Example](#l-example)\n- ### [Debugging](https://github.com/transistorsoft/flutter_background_geolocation/wiki/Debugging)\n- ### [Demo Application](#-demo-application)\n- ### [Testing Server](#-simple-testing-server)\n\n\n## 🔷 Installing the Plugin\n\n📂 **`pubspec.yaml`**:\n\n**Note:** See [Versions](https://pub.dartlang.org/packages/flutter_background_geolocation/#-versions-tab-) for latest available version.\n\n```yaml\ndependencies:\n  flutter_background_geolocation: '^4.12.0'\n```\n\n### Or latest from Git:\n\n```yaml\ndependencies:\n  flutter_background_geolocation:\n    git:\n      url: https://github.com/transistorsoft/flutter_background_geolocation.git\n```\n\n## 🔷 Setup Guides\n\n- [iOS](https://github.com/transistorsoft/flutter_background_geolocation/blob/master/help/INSTALL-IOS.md)\n- [Android](https://github.com/transistorsoft/flutter_background_geolocation/blob/master/help/INSTALL-ANDROID.md)\n\n\n## 🔷 Using the plugin ##\n\n```dart\nimport 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;\n```\n\n⚠️ Note `as bg` in the `import`.  This is important to namespace the plugin's classes, which often use common class-names such as `Location`, `Config`, `State`.  You will access every `flutter_background_geolocation` class with the prefix `bg` (ie: \"**b**ackground **g**eolocation\").\n\n## 🔷 Example\n[Full Example](https://gist.github.com/christocracy/a0464846de8a9c27c7e9de5616082878)\n\nThere are three main steps to using `BackgroundGeolocation`:\n\n1. Wire up event-listeners.\n2. Configure the plugin with `#ready`.\n3. `#start` the plugin.\n\n```dart\n\nimport 'package:flutter_background_geolocation/flutter_background_geolocation.dart' as bg;\n\nclass _MyHomePageState extends State\u003cMyHomePage\u003e {\n\n  @override\n  void initState() {\n    super.initState();\n\n    ////\n    // 1.  Listen to events (See docs for all 12 available events).\n    //\n\n    // Fired whenever a location is recorded\n    bg.BackgroundGeolocation.onLocation((bg.Location location) {\n      print('[location] - $location');\n    });\n\n    // Fired whenever the plugin changes motion-state (stationary-\u003emoving and vice-versa)\n    bg.BackgroundGeolocation.onMotionChange((bg.Location location) {\n      print('[motionchange] - $location');\n    });\n\n    // Fired whenever the state of location-services changes.  Always fired at boot\n    bg.BackgroundGeolocation.onProviderChange((bg.ProviderChangeEvent event) {\n      print('[providerchange] - $event');\n    });\n\n    ////\n    // 2.  Configure the plugin\n    //\n    bg.BackgroundGeolocation.ready(bg.Config(\n        desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH,\n        distanceFilter: 10.0,\n        stopOnTerminate: false,\n        startOnBoot: true,\n        debug: true,\n        logLevel: bg.Config.LOG_LEVEL_VERBOSE\n    )).then((bg.State state) {\n      if (!state.enabled) {\n        ////\n        // 3.  Start the plugin.\n        //\n        bg.BackgroundGeolocation.start();\n      }\n    });\n  }\n}\n\n```\n\n⚠️ Do not execute *any* API method which will require accessing location-services until the callback to **`#ready*` executes (eg: `#getCurrentPosition`, `#watchPosition`, `#start`).\n\n\n## 🔷 Demo Application\n\nA fully-featured Demo App is available in the repo in the [`/example`](./example) folder.\n\n[![Google Play](https://dl.dropboxusercontent.com/s/80rf906x0fheb26/google-play-icon.png?dl=1)](https://play.google.com/store/apps/details?id=com.transistorsoft.flutterbackgroundgeolocationexample)\n\n![Home](https://dl.dropboxusercontent.com/s/wa43w1n3xhkjn0i/home-framed-350.png?dl=1)\n![Settings](https://dl.dropboxusercontent.com/s/8oad228siog49kt/settings-framed-350.png?dl=1)\n\n## 🔷 [Simple Testing Server](https://github.com/transistorsoft/background-geolocation-console)\n\nA simple Node-based [web-application](https://github.com/transistorsoft/background-geolocation-console) with SQLite database is available for field-testing and performance analysis.  If you're familiar with Node, you can have this server up-and-running in about **one minute**.\n\n![](https://dl.dropboxusercontent.com/s/px5rzz7wybkv8fs/background-geolocation-console-map.png?dl=1)\n\n![](https://dl.dropboxusercontent.com/s/tiy5b2oivt0np2y/background-geolocation-console-grid.png?dl=1)\n\n# License\n\nThe MIT License (MIT)\n\nCopyright (c) 2018 Chris Scott, Transistor Software\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransistorsoft%2Fflutter_background_geolocation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransistorsoft%2Fflutter_background_geolocation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransistorsoft%2Fflutter_background_geolocation/lists"}