Code Monkey home page Code Monkey logo

vital-flutter's Introduction

vital_flutter

The official Flutter package for Vital APIs allowing fitness apps linking with tryvital.io and with support for HealthKit.

Installing

Package is available on https://pub.dev.

Getting Started

Initialise client with region, environment and api key

final client = VitalClient()
  ..init(region: Region.eu, environment: Environment.sandbox, apiKey: 'sk_eu_...');

Query users:

final Response<List<User>> usersResponse = client.userService.getAll();

Link data provider:

client.linkProvider(user, 'strava', 'vitalexample://callback');

Note: To return back to the app after successful linking, setup an intent filter in AndroidManifest.xml and custom URL scheme in info.plist. Note 2: Refer to documentation for all supported data providers.

HealthKit

  1. Follow iOS SDK instructions regarding HealthKit capabilities and background delivery setup for your iOS app.

  2. To use HealthKit client you need to call configure first:

await client.healthkitServices.configureClient();
await client.healthkitServices.configureHealthkit(backgroundDeliveryEnabled: true);
  1. Set User ID
client.healthkitServices.setUserId('eba7c0a2-dc01-49f5-a361-...);
  1. Ask user for permissions to collect HealthKit data.
client.healthkitServices.askForResources([
      HealthkitResource.profile,
      HealthkitResource.body,
      ...
    ]);
  1. Sync data
client.healthkitServices.syncData();
  1. Observe sync status using status stream
Stream<SyncStatus> status = client.healthkitServices.status

Documentation

For more example usage run the sample app with your API key and Region set in main.dart. Please refer to the official Vital docs provide a full reference on using this library.

License

vital-flutter is available under the AGPLv3 license. See the LICENSE file for more info. VitalDevices is under the Adept Labs Enterprise Edition (EE) license (the “EE License”). Please refer to its license inside its folder.

vital-flutter's People

Contributors

jankn avatar ruiaaperes avatar maitham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.