executeAll method

Future<void> executeAll()

Implementation

Future<void> executeAll() async {
  await database.init();

  final user = await _getUser();
  bool previousAccess = false;

  if (Platform.isIOS) {
    if (user != null) {
      previousAccess = user.credentials?.any((element) {
            return element.brandId == 6;
          }) ??
          false;
    }
    await executeAppleHealth(
      database,
      preferences,
      http,
      previousAccess,
    );
  }
  if (Platform.isAndroid) {
    if (user != null) {
      previousAccess = user.credentials?.any((element) {
            return element.brandId == 8;
          }) ??
          false;
    }
    await executeGoogleHealthConnect(
      database,
      preferences,
      http,
      previousAccess,
    );
  }

  return;
}