WT1.1.17 +4 pointer fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user