awareframework_locations 0.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new56

awareframework_locations

The accelerometer measures the acceleration applied to the sensor built-in into the device, including the force of gravity.

Install the plugin into project

  1. Edit pubspec.yaml
dependencies:
    awareframework_locations
  1. Import the package on your source code
import 'package:awareframework_locations/awareframework_locations.dart';
import 'package:awareframework_core/awareframework_core.dart';

Public functions

Locations Sensor

  • start()
  • stop()
  • sync(force: Boolean)
  • enable()
  • disable()
  • isEnable()

Configuration Keys

  • geoFences: String? Geofences that are going to be checked on the location updates. If within the range of these fences, then the location is accepted as a permitted update. If null, all location updates are accepted as permitted. String follows the regex in format (?:latitude),(?:longitude)[ \t;]+. (default = null)
  • [^Android Only]statusGps: Boolean true or false to activate or deactivate GPS locations. (default = true)
  • [^Android Only]statusNetwork: Boolean true or false to activate or deactivate Network locations. (default = true)
  • [^Android Only]statusPassive: Boolean true or false to activate or deactivate passive locations. (default = true)
  • frequencyGps: Int how frequent to check the GPS location, in seconds. By default, every 180 seconds. Setting to 0 (zero) will keep the GPS location tracking always on. (default = 180)
  • minGpsAccuracy: Int the minimum acceptable accuracy of GPS location, in meters. By default, 150 meters. Setting to 0 (zero) will keep the GPS location tracking always on. (default = 150)
  • [^Android Only]frequencyNetwork: Int how frequently to check the network location, in seconds. By default, every 300 seconds. Setting to 0 (zero) will keep the network location tracking always on. (default = 300)
  • [^Android Only]minNetworkAccuracy: Int the minimum acceptable accuracy of network location, in meters. By default, 1500 meters. Setting to 0 (zero) will keep the network location tracking always on. (default = 1500)
  • expirationTime: Long the amount of elapsed time, in seconds, until the location is considered outdated. By default, 300 seconds. (default = 300)
  • saveAll: Boolean Whether to save all the location updates or not. (default = false)
  • enabled: Boolean Sensor is enabled or not. (default = false)
  • debug: Boolean enable/disable logging to Logcat. (default = false)
  • label: String Label for the data. (default = "")
  • deviceId: String Id of the device that will be associated with the events and the sensor. (default = "")
  • dbEncryptionKey Encryption key for the database. (default = null)
  • dbType: Engine Which db engine to use for saving data. (default = Engine.DatabaseType.NONE)
  • dbPath: String Path of the database. (default = "aware_locations")
  • dbHost: String Host for syncing the database. (default = null)

[^Android Only]: The function is supported on Android only. iOS does not support the function.

Data Representations

The data representations is different between Android and iOS. Following links provide the information.

Example usage

// init config
var config = LocationsSensorConfig()
  ..debug = true
  ..label = "label";

// init sensor
var sensor = new LocationsSensor(config);

void mathod(){
    /// start 
    sensor.start();
    
    /// set observer
    sensor.onLocationChanged.listen((Map<String,dynamic> result){
      setState((){
        // Your code here
      });
    });
    
    /// stop
    sensor.stop();
    
    /// sync
    sensor.sync(true);  
    
    // make a sensor care by the following code
    var card = new LocationCard(sensor:sensor);
    // NEXT: Add the card instance into a target Widget.
}

License

Copyright (c) 2018 AWARE Mobile Context Instrumentation Middleware/Framework (http://www.awareframework.com)

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LI CENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

0.0.1

  • TODO: Describe initial release.

example/README.md

awareframework_locations_example

Demonstrates how to use the awareframework_locations plugin.

Getting Started

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  awareframework_locations: ^0.0.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:awareframework_locations/awareframework_locations.dart';
  
Version Uploaded Documentation Archive
0.0.4 Nov 29, 2018 Go to the documentation of awareframework_locations 0.0.4 Download awareframework_locations 0.0.4 archive
0.0.3 Nov 24, 2018 Go to the documentation of awareframework_locations 0.0.3 Download awareframework_locations 0.0.3 archive
0.0.2 Nov 22, 2018 Go to the documentation of awareframework_locations 0.0.2 Download awareframework_locations 0.0.2 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
25
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
70
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7
  • Flutter: 1.0.0

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Fix lib/awareframework_locations.dart. (-0.50 points)

Analysis of lib/awareframework_locations.dart reported 1 hint:

line 94 col 7: This class inherits from a class marked as @immutable, and therefore should be immutable (all instance fields must be final).

Maintenance suggestions

The description is too short. (-20 points)

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Package is pre-v0.1 release. (-10 points)

While there is nothing inherently wrong with versions of 0.0.*, it usually means that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
awareframework_core ^0.0.9 0.0.10
flutter 0.0.0
Transitive dependencies
charts_common 0.5.0
charts_flutter 0.5.0
collection 1.14.11
intl 0.15.7
logging 0.11.3+2
meta 1.1.6
path 1.6.2
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8