feat: fav topic

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-17 21:55:36 +08:00
parent 1d4eabb770
commit d7eb734aaf
55 changed files with 1509 additions and 500 deletions

View File

@@ -450,6 +450,19 @@ class PiliScheme {
return true;
}
return false;
case 'm.bilibili.com':
// bilibili://m.bilibili.com/topic-detail?topic_id=1028161&frommodule=H5&h5awaken=xxx
final id =
RegExp(r'topic_id=(\d+)').firstMatch(uri.query)?.group(1);
if (id != null) {
PageUtils.toDupNamed(
'/dynTopic',
parameters: {'id': id},
off: off,
);
return true;
}
return false;
default:
if (selfHandle.not) {
debugPrint('$uri');
@@ -629,9 +642,10 @@ class PiliScheme {
bool isSeason = id.startsWith('ss');
id = id.substring(2);
PageUtils.viewBangumi(
seasonId: isSeason ? id : null,
epId: isSeason ? null : id,
progress: uri.queryParameters['start_progress']);
seasonId: isSeason ? id : null,
epId: isSeason ? null : id,
progress: uri.queryParameters['start_progress'],
);
return true;
}
launchURL();
@@ -658,7 +672,11 @@ class PiliScheme {
.firstMatch(path)
?.group(1);
if (id != null) {
Get.toNamed('/articleList', parameters: {'id': id});
PageUtils.toDupNamed(
'/articleList',
parameters: {'id': id},
off: off,
);
return true;
}
launchURL();
@@ -707,6 +725,18 @@ class PiliScheme {
}
launchURL();
return false;
case 'topic-detail':
String? id = RegExp(r'topic_id=(\d+)').firstMatch(uri.query)?.group(1);
if (id != null) {
PageUtils.toDupNamed(
'/dynTopic',
parameters: {'id': id},
off: off,
);
return true;
}
launchURL();
return false;
default:
Map map = IdUtils.matchAvorBv(input: area?.split('?').first);
if (map.isNotEmpty) {

View File

@@ -37,7 +37,7 @@ import 'package:PiliPlus/utils/login_utils.dart';
import 'package:PiliPlus/utils/set_int_adapter.dart';
import 'package:cookie_jar/cookie_jar.dart';
import 'package:flutter/material.dart';
import 'package:get/get_navigation/src/routes/transitions_type.dart';
import 'package:get/get.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart';
import 'package:uuid/uuid.dart';
@@ -479,6 +479,20 @@ class GStorage {
static bool get optTabletNav =>
GStorage.setting.get(SettingBoxKey.optTabletNav, defaultValue: true);
static bool get horizontalScreen {
bool isTablet;
if (Get.context != null) {
isTablet = Get.context!.isTablet;
} else {
final view = WidgetsBinding.instance.platformDispatcher.views.first;
final screenSize = view.physicalSize / view.devicePixelRatio;
final shortestSide = min(screenSize.width.abs(), screenSize.height.abs());
isTablet = shortestSide >= 600;
}
return GStorage.setting
.get(SettingBoxKey.horizontalScreen, defaultValue: isTablet);
}
static List<double> get dynamicDetailRatio => List<double>.from(setting
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: const [60.0, 40.0]));