movisens_flutter 0.1.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 63

movisens_flutter_plugin #

pub package

A plugin for connecting and collecting data from a Movisens sensor. This plugin excelusively works for Android.

Install #

Add movisens_flutter as a dependency in pubspec.yaml. For help on adding as a dependency, view the documentation.

Android permissions #

Add the following to your manifest

    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />

Example Usage #

A Movisens object is instantiated by providing a UserData object, which is, in essence a Map structure containing a list of required fields for the Movisens sensor. These include: Weight, height, age, sensor address and sensor name.

Intialization: #

Movisens _movisens;
StreamSubscription<MovisensDataPoint> _subscription;
LogManager logManager = new LogManager();
List<MovisensDataPoint> movisensEvents = [];
String address = 'unknown', name = 'unknown';
int weight, height, age;

Start Listening #

Data from the sensor is streamed continuously, which is done by calling the listen() method on a Movisens object. An exception will be thrown if the listen method is invoked on a platform other than Android.

void startListening() {
    address = '88:6B:0F:82:1D:33';
    name = 'Sensor 02655';
    weight = 100;
    height = 180;
    age = 25;
    UserData userData = new UserData(
        weight, height, Gender.male, age, SensorLocation.chest, address, name);
    _movisens = new Movisens(userData);
    try {
      _subscription = _movisens.movisensStream.listen(onData);
    } on MovisensException catch (exception) {

Additionally, it can be a good idea to have a separate method for handling incoming data, such as the onData method shown below:

void onData(MovisensDataPoint d) {
    setState(() {

Stop Listening #

The subscription can be cancelled again, by invoking the cancel method:

void stopListening() {

image# movisens_plugin


  • Code clean-up and documentation


  • Changed path provider from ^0.5.0 to 1.2.0


  • Fixed Movisens core Android library for foreground service and notification error. Now notification is removed on app kill


  • Changed Movisens core Android library for foreground service notification on Android>8.1

0.1.2 #

  • MovisensDataPoint removed and replaced with a Map.

0.1.1 #

  • Initial release.


movisens_flutter_example #

Demonstrates how to use the movisens_flutter plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  movisens_flutter: ^0.1.6

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:movisens_flutter/movisens_flutter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 11, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

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

Analysis of lib/movisens_flutter.dart reported 1 hint:

line 10 col 8: Unused import: 'dart:convert'.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
path_provider ^1.2.0 1.4.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.7 1.1.8
platform 2.2.1
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies