carp_core 0.1.1

  • README.md
  • CHANGELOG.md
  • 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.

Usage

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

0.1.1

  • added pubspec.yaml to example.dart

0.1.0

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

example/example.dart

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

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

  print("JSON serialization");
  print(_encode(study));
}

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.addMeasure(m);
    _study.addTask(task);

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

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

    _study.addTask(_sensorTask);

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

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

    _study.addTask(_pedometerTask);

    _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:


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
34
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
67
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

Platforms

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.

Dependencies

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
flutter_test
json_serializable ^1.0.0