refresh static method
Clears service workers and caches and reloads into the newest build; always works. UButton(title: "Update", onTap: UWebUpdate.refresh)
Implementation
static Future<void> refresh({
List<String> assets = defaultAssets,
bool bustUrl = false,
}) async {
if (!UApp.isWeb) return;
final String base = UWebBridge.baseUrl();
await UWebBridge.unregisterServiceWorkers();
await UWebBridge.clearCaches();
await UWebBridge.revalidate(<String>[UWebBridge.documentUrl(), for (final String asset in assets) "$base$asset"]);
UWebBridge.reload(bustUrl ? _bustedUrl() : null);
}