executeGoogleHealthConnect method
Future<void>
executeGoogleHealthConnect(
- Database database,
- Preferences preferences,
- Http http,
- bool previousAccess,
Implementation
Future<void> executeGoogleHealthConnect(
Database database,
Preferences preferences,
Http http,
bool previousAccess,
) async {
await database.init();
final accessGranted =
await preferences.getGoogleHealthConnectAccessGranted();
if (accessGranted || previousAccess) {
if (!accessGranted) {
await preferences.setGoogleHealthConnectAccessGranted(true);
}
await _getGoogleHealthConnectData(preferences, http);
await _syncGoogleHealthConnectData(database);
await _deleteOldGoogleHealthConnectElements(database);
}
}