mod: web down

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-10 11:13:02 +08:00
parent 8f5c2bf3ba
commit a951d42623

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:PiliPlus/http/constants.dart';
import 'package:PiliPlus/http/init.dart';
@@ -196,16 +197,18 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
// ''',
// );
},
onDownloadStartRequest: (controller, request) {
onDownloadStartRequest: Platform.isAndroid
? (controller, request) {
showDialog(
context: context,
builder: (context) {
String suggestedFilename =
request.suggestedFilename.toString();
String fileSize =
CacheManage.formatSize(request.contentLength.toDouble());
String fileSize = CacheManage.formatSize(
request.contentLength.toDouble());
try {
suggestedFilename = Uri.decodeComponent(suggestedFilename);
suggestedFilename =
Uri.decodeComponent(suggestedFilename);
} catch (e) {
debugPrint(e.toString());
}
@@ -230,7 +233,8 @@ class _WebviewPageNewState extends State<WebviewPageNew> {
);
});
_progressStream.add(1);
},
}
: null,
shouldOverrideUrlLoading: (controller, navigationAction) async {
final String? str =
navigationAction.request.url!.pathSegments.getOrNull(0);