Add helpers for boolean functions

This commit is contained in:
Oliver Walters committed 2023-04-21 21:09:02 +10:00
1 parent f253234b94
commit 88a02eb9ef
2 files changed
+13

No files matched your search

+12
View File
@@ -1365,6 +1365,12 @@ class InvenTreeAPI {
}
}
// Return a boolean global setting value
Future<bool> getGlobalBooleanSetting(String key) async {
String value = await getGlobalSetting(key);
return value.toLowerCase() == "true";
}
Future<String> getUserSetting(String key) async {
if (!supportsSettings) return "";
@@ -1385,6 +1391,12 @@ class InvenTreeAPI {
}
}
// Return a boolean user setting value
Future<bool> getUserBooleanSetting(String key) async {
String value = await getUserSetting(key);
return value.toLowerCase() == "true";
}
/*
* Send a request to the server to locate / identify either a StockItem or StockLocation
*/