WT1.1.17 +4 pointer fix

This commit is contained in:
bossanyit
2021-05-16 23:48:57 +02:00
parent 7b0d15aede
commit 4b6b4dafc7
18 changed files with 187 additions and 93 deletions
@@ -0,0 +1,24 @@
import 'package:aitrainer_app/model/cache.dart';
import 'package:aitrainer_app/service/logging.dart';
import 'package:firebase_remote_config/firebase_remote_config.dart';
class RemoteConfigRepository with Logging {
RemoteConfig? remoteConfig;
String getConfigValue(String configKey, String baseValue) {
String value = "";
remoteConfig = Cache().remoteConfig;
if (remoteConfig != null) {
remoteConfig!.fetchAndActivate();
Map config = remoteConfig!.getAll();
RemoteConfigValue? configValue = config[configKey];
if (configValue != null && configValue.asString().isNotEmpty) {
log("RemoteConfig $configKey value: ${configValue.asString()}");
if (configValue.asString() == baseValue) {
value = configValue.asString();
}
}
}
return value;
}
}