setQueryType method Null safety
- dynamic userPreferences
Sets the query type according to the current UserPreferences
Implementation
static void setQueryType(final UserPreferences userPreferences) {
OpenFoodAPIConfiguration.globalQueryType = userPreferences
.getFlag(UserPreferencesDevMode.userPreferencesFlagProd) ??
true
? QueryType.PROD
: QueryType.TEST;
final String? testEnvHost = userPreferences
.getDevModeString(UserPreferencesDevMode.userPreferencesTestEnvHost);
if (testEnvHost != null) {
OpenFoodAPIConfiguration.uriTestHost = testEnvHost;
}
}