onClose method
Handles tasks to be performed before closing the response.
This includes replacing placeholders for assets like JS and CSS in layout
.
Implementation
String onClose(String layout) {
// 1. Replace assets values.
if (dataJsId.isNotEmpty) {
layout = layout.replaceFirst(dataJsId, assetManager.getDataJs());
}
// 2. Reolace assets url Js, Css
if (cssRenderId.isNotEmpty) {
layout = layout.replaceFirst(cssRenderId, assetManager.getCssUI());
}
if (jsRenderId.isNotEmpty) {
layout = layout.replaceAll(jsRenderId, assetManager.getJsUI());
}
return layout;
}