uploadGoogleHealthConnectArrayData method

Future<bool> uploadGoogleHealthConnectArrayData(
  1. String apiKey,
  2. String customerId,
  3. String externalUserId,
  4. List<Map<String, String>> data,
)

Implementation

Future<bool> uploadGoogleHealthConnectArrayData(
  String apiKey,
  String customerId,
  String externalUserId,
  List<Map<String, String>> data,
) async {
  try {
    final payload = {
      'externalUserId': externalUserId,
      'version': 2,
      'data': data
    };
    await dio.post(
      '${Config.url}/custom-data/google-health/upload',
      data: payload,
      options: Options(
        headers: {
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          "x-api-key": apiKey,
          "x-customer": customerId,
        },
      ),
    );

    return true;
  } catch (e) {
    return false;
  }
}