mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-06-10 15:59:25 +08:00
14 lines
382 B
Dart
14 lines
382 B
Dart
// ignore: avoid_web_libraries_in_flutter
|
|
import 'dart:html';
|
|
|
|
void replaceCurrentRoute(String query) {
|
|
const usePathUrl = bool.fromEnvironment("usePathUrl");
|
|
if (usePathUrl) {
|
|
final q = query.substring(1);
|
|
final base = document.baseUri ?? "/";
|
|
window.history.replaceState(null, "", "$base$q");
|
|
} else {
|
|
window.history.replaceState(null, "", "#$query");
|
|
}
|
|
}
|