Research Package
This is a Flutter package implementing support for surveys and obtaining informed consent containing models, UI elements and screens. The motivation is coming from two similar native libraries ResearchStack and ResearchKit.
The main modules of the above mentioned libraries are:
- Consent - How it's done in ResearchKit - Implemented
- Survey - How it's done in ResearchKit - Implemented
- Active Task - How it's done in ResearchKit - Can be implemented later with the help of flutter plugins by CACHET.
Getting Started
Research Package is published to Pub:
You can start using it by adding it to your dependencies.
After you run the flutter packages get
command you are able to import and start using Research Package. With the following line you have access both to the Model and the UI part of the package.
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
).
Example application
To get an overview of Research Package's features please have a look at the example application available in this folder.
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.
Naming
We are following Apple's pattern when it comes to naming. There's a prefix ORK (Open Research Kit) before the names of classes, types etc. in ResearchKit, so our names are starting with the RP prefix which stands for Research Package.
For UI widgets we are using the RPUI (Research Package UI) prefix.
Useful Links
In order to familiarize with the Framework and potentially extend it, it's might worth to have a look at these links about Research Kit and Research Stack.
-
ResearchKit
- Official Tutorial on how to use ResearchKit in ObjectiveC You can get a good understading of the flow and the basic concepts. Also there's a useful presentation of the different AnswerFormats.
- Hierarchy of objects in ResearchKit This is a good representation of a possible file/class hierarchy for ResearchPackage.
- Tutorial on how to use ResearchKit in Swift
- Sample Apps for ResearchKit in Swift
-
ResearchStack
Libraries
- research_package
- research_package_model
-
The domain model part of Research Package.
Contains the "building blocks" for creating surveys and obtaining informed consents.
Holds the different types of result classes.
Also responsible for the streams and BLoC classes to provide communication channels
between different parts of the package. (
BlocQuestion
, BlocTask) For the UI representations of the classes visit the research_package_ui library. - research_package_ui
- The UI library of Research Package. [...]
Dart
- dart:ui
- Built-in types and core primitives for a Flutter application. [...]
- dart:async
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- dart:collection
- Classes and utilities that supplement the collection support in dart:core. [...]
- dart:convert
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- dart:core
- Built-in types, collections, and other core functionality for every Dart program. [...]
- dart:developer
- Interact with developer tools such as the debugger and inspector. [...]
- dart:math
- Mathematical constants and functions, plus a random number generator. [...]
- dart:typed_data
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- dart:ffi
- Foreign Function Interface for interoperability with the C programming language. [...]
- dart:io
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- dart:isolate
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]
- dart:html
- HTML elements and other resources for web-based applications that need to interact with the browser and the DOM (Document Object Model). [...]
- dart:js
- Low-level support for interoperating with JavaScript. [...]
- dart:js_util
- Utility methods to efficiently manipulate typed JSInterop objects in cases where the name to call is not known at runtime. You should only use these methods when the same effect cannot be achieved with @JS annotations. These methods would be extension methods on JSObject if Dart supported extension methods.