carp_core 0.1.1

  • Example
  • Installing
  • Versions
  • new67

CARP Core Domain Model

This library contains the core CARP domain model as Flutter classes.

pub package

This library does nothing in itself, but provides the domain model for the other CARP plugins. See CARP Mobile Sensing in Flutter.

The domain model is described on the CARP Mobile Sensing Framework in Flutter wiki.


To use this plugin, add carp_core as a dependency in your pubspec.yaml file.


  • added pubspec.yaml to example.dart


  • Initial version. Moving domain classes out of the carp_mobile_sensing Flutter plugin.


import 'package:carp_core/carp_core.dart';
import 'dart:convert';

void main() {
  print("Creating a simple study");

  print("JSON serialization");

String _encode(Object object) => const JsonEncoder.withIndent(' ').convert(object);

Study _study;
Study get study {
  if (_study == null) {
    _study = new Study("1234", "bardram", name: "bardram study");
    _study.dataEndPoint = new FileDataEndPoint(DataEndPointType.FILE);

    Task task = new Task("Generic task");
    final Measure m = new Measure(Measure.GENERIC_MEASURE, name: 'Generic measure');
    m.setConfiguration("generic_1", "8000");
    m.setConfiguration("generic_2", "abc");

    Task _sensorTask = new ParallelTask("Sensor task");
    final ProbeMeasure am = new ProbeMeasure(Measure.PROBE_MEASURE); = 'Accelerometer';
    am.setConfiguration("frequency", "8000");
    am.setConfiguration("duration", "500");

    ListeningProbeMeasure gm = new ListeningProbeMeasure(Measure.LISTENING_MEASURE); = 'Gyroscope';
    gm.setConfiguration("frequency", "8000");


    Task _pedometerTask = new SequentialTask("Pedometer task");

    PollingProbeMeasure pm = new PollingProbeMeasure(Measure.POLLING_MEASURE); = 'Pedometer';
    pm.frequency = 8 * 1000; // once every 8 second


    _study.addTask(ParallelTask("Connectivity task"));

  return _study;

Use this package as a library

1. Depend on it

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

  carp_core: ^0.1.1

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:carp_core/carp_core.dart';
Version Uploaded Documentation Archive
0.1.1 Dec 5, 2018 Go to the documentation of carp_core 0.1.1 Download carp_core 0.1.1 archive
0.1.0 Nov 14, 2018 Go to the documentation of carp_core 0.1.0 Download carp_core 0.1.0 archive
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 Dec 6, 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


Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

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

Analysis of lib/serialization.dart reported 1 hint:

line 25 col 3: The method '_registerFromJson' isn't used.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
device_info ^0.2.1 0.2.1 0.3.0
flutter 0.0.0
json_annotation ^1.0.0 1.2.0 2.0.0
uuid ^1.0.0 1.0.3
Transitive dependencies
charcode 1.1.2
collection 1.14.11
convert 2.0.2
crypto 2.0.6
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build_runner any
json_serializable ^1.0.0