WT1.1.3 logo change, error fixes
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:aitrainer_app/service/logging.dart';
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:health/health.dart';
|
||||
//import 'package:health/health.dart';
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
part 'settings_event.dart';
|
||||
@@ -50,17 +50,19 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> with Logging {
|
||||
|
||||
bool selectedHardwareBefore = await Cache().selectedHardwareBefore();
|
||||
log("selectedBefore " + selectedHardwareBefore.toString());
|
||||
if (!selectedHardwareBefore) {
|
||||
await _accessHealthData();
|
||||
}
|
||||
|
||||
final bool hasHardware = event.hasHardware;
|
||||
await Cache().setHardware(hasHardware);
|
||||
if (hasHardware == true) {
|
||||
await _accessHealthData();
|
||||
}
|
||||
Cache().initBadges();
|
||||
yield SettingsReady(_locale);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _accessHealthData() async {
|
||||
final List<HealthDataType> types = [
|
||||
/* final List<HealthDataType> types = [
|
||||
HealthDataType.ACTIVE_ENERGY_BURNED,
|
||||
HealthDataType.WATER,
|
||||
HealthDataType.STEPS,
|
||||
@@ -71,10 +73,10 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> with Logging {
|
||||
HealthDataType.LOW_HEART_RATE_EVENT,
|
||||
HealthDataType.RESTING_HEART_RATE
|
||||
];
|
||||
final HealthFactory health = HealthFactory();
|
||||
final HealthFactory health = HealthFactory(); */
|
||||
DateTime now = DateTime.now();
|
||||
List<HealthDataPoint> _healthDataList = await health.getHealthDataFromTypes(now.subtract(Duration(minutes: 5)), now, types);
|
||||
log(_healthDataList.toString());
|
||||
//List<HealthDataPoint> _healthDataList = await health.getHealthDataFromTypes(now.subtract(Duration(minutes: 5)), now, types);
|
||||
//log(_healthDataList.toString());
|
||||
}
|
||||
|
||||
Future<void> _changeLang(String lang) async {
|
||||
@@ -94,6 +96,7 @@ class SettingsBloc extends Bloc<SettingsEvent, SettingsState> with Logging {
|
||||
this.language = lang;
|
||||
AppLanguage().changeLanguage(_locale);
|
||||
await loadLang();
|
||||
await Cache().initBadges();
|
||||
}
|
||||
|
||||
Future<void> loadLang() async {
|
||||
|
||||
Reference in New Issue
Block a user