mraa 1.1.1

mraa #

Build Status

An implementation of the Intel MRAA linux library for Dart.

This is a full implementation of MRAA allowing low level access to sensor devices on a range of supported linux based boards and development environments. This permits low level IOT device control and management directly from the Dart VM.

The implementation is an FFI wrapper around the target boards libmraa library, which can be set to the distro standard libmraa or any libmraa you wish to use yourself. Currently Version 2.0.0 of MRAA is supported.

The API itself is a complete implementation(see for the few functions not implemented) and is structured as per the MRAA C API, e.g to access an analogue IO pin a call like this would be used :-;

Other API functions for GPIO, I2C etc are accessed in a similar manner.

The examples directory contains some general usage examples. Examples of using mrra with real sensors can be found in the grove package.

Note that to access some devices, GPIO is an example here, you may need elevated permissions, this can be achieved by running Dart under sudo, running as root or adding your user to the appropriate device group.

1.1.1 #

Linter updates

1.1.0 #

Issue 1

1.0.0 #

Initial release


 * Package : mraa
 * Author : S. Hamblett <>
 * Date   : 03/10/2019
 * Copyright :  S.Hamblett

import 'package:mraa/mraa.dart';

// ignore_for_file: omit_local_variable_types
// ignore_for_file: unnecessary_final
// ignore_for_file: cascade_invocations
// ignore_for_file: avoid_print

int main() {
  final Mraa mraa = Mraa();

  // Set any options such as no JSON loading here
  // mraa.noJsonLoading = true;

  // Initialise the package, you MUST do this after setting any
  // options if you don't the API calls will throw no such method error.

  // Call the MRAA API functions
  final String mraaVersion = mraa.common.version();
  print('Version is : $mraaVersion');

  return 0;

Use this package as a library

1. Depend on it

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

  mraa: ^1.1.1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:mraa/mraa.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 Feb 12, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
ffi ^0.1.3-dev.3 0.1.3
Dev dependencies
test ^1.9.3