feat: open in browser

Closes #140

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-11 10:05:01 +08:00
parent 54d13fe7f2
commit 2d338450f4
17 changed files with 60 additions and 166 deletions

View File

@@ -40,6 +40,24 @@ class Utils {
static const channel = MethodChannel("PiliPlus");
static void handleWebview(String url, {bool off = false}) {
if (GStorage.openInBrowser) {
launchURL(url);
} else {
if (off) {
Get.offNamed(
'/webview',
parameters: {'url': url},
);
} else {
toDupNamed(
'/webview',
parameters: {'url': url},
);
}
}
}
static bool viewPgcFromUri(String uri) {
String? id = RegExp(r'(ep|ss)\d+').firstMatch(uri)?.group(0);
if (id != null) {