research_package 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 69

Research Package #

pub package

Research Package is a Flutter package for creating surveys and obtaining informed consent containing models, UI elements and screens. The motivation is coming from two similar native libraries ResearchStack on Android and ResearchKit on iOS.

The main modules of the above mentioned libraries are which are also the main features of Research Package:

To find out more visit Research Package's website at researchpackage.org.

Getting Started #

Research Package is published to Pub: pub package

You can start using it by adding it to your dependencies.

After you run flutter packages get command you are able to import and start using Research Package. You can import the whole package including the Model and UI libraries:

import 'package:research_package/research_package.dart';

Or with the following lines you can decide which library of the package you want to gain access to:

import 'package:research_package/model.dart';
import 'package:research_package/ui.dart';

Remember, that objects starting with RP are part of the Model (like RPConsentDocument) while those which start with RPUI are part of the UI library (like RPUIVisualConsentStep).

Documentation #

Visit the website of the project at researchpackage.org for more information and tutorials.

You can find the API documentation generated for pub here.

Example application #

To get an overview of Research Package's features have a look at the example application here.

Similarity to ResearchKit and ResearchStack #

Research Package is clearly similar to these two existent framework. A goal with the package was to help developers enjoy the same features with Flutter's cross-platform framework. The names, functionalities and most of the logic are similar or identical to the previously mentioned two framework. This way we believe that the transition for those who have used them before will be easier and smoother.

Current stage #

The project is work in progress. New Answer Formats are being added to the survey module of the framework constanly. The available Answer Formats are the following at the moment:

  • Single Choice
  • Multiple Choice
  • Integer

Use Cases #

One of the goals for the package was to make it capable of handling a WHO5 survey. As an example at this point Research Package can obtain the informed consent from the participant, show the WHO5 survey questions and collect the results.

In order to familiarize with the framework and potentially extend it, it might worth to have a look at these links about Research Kit and Research Stack.

0.1.2 #

  • Support for new Answer Formats
    • Slider
    • Date and Time
    • Image Choice
  • rx_dart dependency updated to ^0.23.0
  • Small bug fixes and documentation update

0.1.1 #

  • json_annotation dependency updated to ^3.0.0
  • rx_dart dependency updated to ^0.22.0

0.1.0 #

  • Form Step feature added
  • Bug fixing

0.0.4 #

  • Example application added

0.0.3 #

  • Initial release for Pub
  • Support for three Answer Formats
    • Single Choice
    • Multiple Choice
    • Integer

0.0.2 #

  • Added initial support for serialization to/from JSON
  • JSON serialization is available for these classes:
    • RPAnswerFormat
    • RPChoiceAnswerFormat
    • RPIntegerAnswerFormat
    • RPConsentDocument
    • RPConsentSection
    • RPSignatureResult
    • RPStepResult
    • RPTaskResult
    • RPChoice

0.0.1 #

  • Initial release
  • Entire framework done
  • Support for SingleChoice question type

example/README.md

Research Package Demo Application #

There is a demo application provided for Research Package. It presents the two main features: Obtaining informed consent and creating surveys.

The application can be accessed here: Demo App

All Research Packages' available step and answer types are showcased as well as a signature screen with name and signature image input.

Use this package as a library

1. Depend on it

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


dependencies:
  research_package: ^0.1.2

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:research_package/research_package.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
69
Learn more about scoring.

We analyzed this package on Jan 17, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/src/ui/QuestionBody/RPUIDateTimeQuestionBody.dart. (-1 points)

Analysis of lib/src/ui/QuestionBody/RPUIDateTimeQuestionBody.dart reported 2 hints:

line 3 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: RPUIDateTimeQuestionBody.mode

line 22 col 10: The value of the field '_errorMessage' isn't used.

Fix lib/model.g.dart. (-0.50 points)

Analysis of lib/model.g.dart reported 1 hint:

line 220 col 22: The declaration '_$RPImageChoiceToJson' isn't referenced.

Fix lib/src/ui/QuestionBody/RPUIImageChoiceQuestionBody.dart. (-0.50 points)

Analysis of lib/src/ui/QuestionBody/RPUIImageChoiceQuestionBody.dart reported 1 hint:

line 16 col 10: The value of the field '_errorMessage' isn't used.

Fix additional 30 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/src/ui/RPUIFormStep.dart (1 hint)
  • lib/src/model/answerformat/RPAnswerFormat.dart (Run flutter format to format lib/src/model/answerformat/RPAnswerFormat.dart.)
  • lib/src/model/answerformat/RPChoiceAnswerFormat.dart (Run flutter format to format lib/src/model/answerformat/RPChoiceAnswerFormat.dart.)
  • lib/src/model/answerformat/RPFormAnswerFormat.dart (Run flutter format to format lib/src/model/answerformat/RPFormAnswerFormat.dart.)
  • lib/src/model/answerformat/RPIntegerAnswerFormat.dart (Run flutter format to format lib/src/model/answerformat/RPIntegerAnswerFormat.dart.)
  • lib/src/model/blocs/BlocTask.dart (Run flutter format to format lib/src/model/blocs/BlocTask.dart.)
  • lib/src/model/consent/RPConsentDocument.dart (Run flutter format to format lib/src/model/consent/RPConsentDocument.dart.)
  • lib/src/model/consent/RPConsentReviewStep.dart (Run flutter format to format lib/src/model/consent/RPConsentReviewStep.dart.)
  • lib/src/model/consent/RPConsentSection.dart (Run flutter format to format lib/src/model/consent/RPConsentSection.dart.)
  • lib/src/model/consent/RPConsentSignature.dart (Run flutter format to format lib/src/model/consent/RPConsentSignature.dart.)
  • lib/src/model/consent/RPVisualConsentStep.dart (Run flutter format to format lib/src/model/consent/RPVisualConsentStep.dart.)
  • lib/src/model/result/RPConsentSignatureResult.dart (Run flutter format to format lib/src/model/result/RPConsentSignatureResult.dart.)
  • lib/src/model/result/RPQuestionBodyResult.dart (Run flutter format to format lib/src/model/result/RPQuestionBodyResult.dart.)
  • lib/src/model/result/RPSignatureResult.dart (Run flutter format to format lib/src/model/result/RPSignatureResult.dart.)
  • lib/src/model/result/RPStepResult.dart (Run flutter format to format lib/src/model/result/RPStepResult.dart.)
  • lib/src/model/result/RPTaskResult.dart (Run flutter format to format lib/src/model/result/RPTaskResult.dart.)
  • lib/src/model/step/RPFormStep.dart (Run flutter format to format lib/src/model/step/RPFormStep.dart.)
  • lib/src/model/step/RPInstructionStep.dart (Run flutter format to format lib/src/model/step/RPInstructionStep.dart.)
  • lib/src/model/step/RPQuestionStep.dart (Run flutter format to format lib/src/model/step/RPQuestionStep.dart.)
  • lib/src/model/step/RPStep.dart (Run flutter format to format lib/src/model/step/RPStep.dart.)
  • lib/src/model/task/RPOrderedTask.dart (Run flutter format to format lib/src/model/task/RPOrderedTask.dart.)
  • lib/src/ui/QuestionBody/RPUIChoiceQuestionBody.dart (Run flutter format to format lib/src/ui/QuestionBody/RPUIChoiceQuestionBody.dart.)
  • lib/src/ui/QuestionBody/RPUIIntegerQuestionBody.dart (Run flutter format to format lib/src/ui/QuestionBody/RPUIIntegerQuestionBody.dart.)
  • lib/src/ui/RPStyles.dart (Run flutter format to format lib/src/ui/RPStyles.dart.)
  • lib/src/ui/RPUICompletionStep.dart (Run flutter format to format lib/src/ui/RPUICompletionStep.dart.)
  • lib/src/ui/RPUIConsentReviewStep.dart (Run flutter format to format lib/src/ui/RPUIConsentReviewStep.dart.)
  • lib/src/ui/RPUIOrderedTask.dart (Run flutter format to format lib/src/ui/RPUIOrderedTask.dart.)
  • lib/src/ui/RPUIOrderedTask_versions.dart (Run flutter format to format lib/src/ui/RPUIOrderedTask_versions.dart.)
  • lib/src/ui/RPUIQuestionStep.dart (Run flutter format to format lib/src/ui/RPUIQuestionStep.dart.)
  • lib/src/ui/RPUIVisualConsentStep.dart (Run flutter format to format lib/src/ui/RPUIVisualConsentStep.dart.)

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (signature).

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
json_annotation ^3.0.0 3.0.1
rxdart ^0.23.0 0.23.1
signature ^2.0.0 2.0.1 3.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
build_runner ^1.0.0
flutter_test
json_serializable ^3.0.0
test ^1.6.3