updateLogicalPageName static method
Updates the logical page name for a given screen.
This method takes the name of the screen and a JSON string as input, and performs the necessary operations to update the logical page name.
screenName The name of the screen whose logical page name is to be updated.
jsonString A JSON string containing the data required for the update.
Returns a String representing the updated logical page name.
Implementation
static String updateLogicalPageName(String screenName, String jsonString) {
tlLogger.t(
'ConnectHelper.updateLogicalPageName - Original logicalPageName:$screenName',
);
if (jsonString.isEmpty) {
return screenName;
}
// Decode JSON
final Map<String, dynamic> jsonConfig = jsonDecode(jsonString);
if (jsonConfig.containsKey(screenName)) {
screenName = jsonConfig[screenName]['DisplayName'] ?? screenName;
} else if (jsonConfig.containsKey('GlobalScreenSettings')) {
screenName =
jsonConfig['GlobalScreenSettings']['DisplayName'] ?? screenName;
}
return screenName;
}