Terra Flutter

We provide a Flutter bridge for our SDKs so that it you do not have to deal with the hassle yourself!

Installation

flutter pub add terra_flutter_bridge

Usage:

Regardless of Android or iOS, here are the functions available that you can import from terra_flutter_bridge (platform check is delt with under the hood):

// initialise terra with timer intervals
static Future<bool?> initTerra(
      String devID,
      String apiKey,
      String referenceID,
      int intervalMinutes,
      List<String> connections, //"GOOGLE_FIT", "SAMSUNG", "APPLE_HEALTH", "FREESTYLE_LIBRE"
      List<String> permissions) // "BODY", "DAILY", "SLEEP", "ACTIVITY", "NUTRITION", "ATHLETE"


// check a particular terra connection auth
static Future<bool?> checkAuth(String connection)

// get body data for a connection
static Future<bool?> getBody(
      String connection, DateTime startDate, DateTime endDate)

// get activity data for a connection
static Future<bool?> getActivity(
      String connection, DateTime startDate, DateTime endDate)

// get athlete data for a connection
static Future<bool?> getAthlete(String connection)

// get daily data for a connection
static Future<bool?> getDaily(
      String connection, DateTime startDate, DateTime endDate)

// get sleep data for a connection
  static Future<bool?> getSleep(
      String connection, DateTime startDate, DateTime endDate) 

// get nutrition data for a connection
  static Future<bool?> getNutrition(
      String connection, DateTime startDate, DateTime endDate)

// init freestyle (just for Apple)
  static Future<bool?> readGlucoseData() 

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT