mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
@@ -481,7 +481,7 @@ class PiliScheme {
|
||||
try {
|
||||
index = FavTabType.values.byName(tab).index;
|
||||
} catch (e) {
|
||||
if (kDebugMode) print('favorite jump: $e');
|
||||
if (kDebugMode) debugPrint('favorite jump: $e');
|
||||
}
|
||||
}
|
||||
Get.toNamed('/fav', arguments: index);
|
||||
|
||||
@@ -21,11 +21,7 @@ class DurationUtil {
|
||||
if (data == null || data.isEmpty) {
|
||||
return 0;
|
||||
}
|
||||
List<int> split = data
|
||||
.split(':')
|
||||
.reversed
|
||||
.map(int.parse)
|
||||
.toList();
|
||||
List<int> split = data.split(':').reversed.map(int.parse).toList();
|
||||
int duration = 0;
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
duration += split[i] * pow(60, i).toInt();
|
||||
|
||||
@@ -209,3 +209,7 @@ extension ThreeDotItemTypeExt on ThreeDotItemType {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension SizeExt on Size {
|
||||
bool get isPortrait => width < 600 || height >= width;
|
||||
}
|
||||
|
||||
@@ -44,17 +44,12 @@ class PageUtils {
|
||||
ValueChanged<int>? onDismissed,
|
||||
int? quality,
|
||||
}) {
|
||||
final currentRoute = Get.currentRoute;
|
||||
bool noneSet =
|
||||
currentRoute.startsWith('/videoV') ||
|
||||
currentRoute.startsWith('/member?');
|
||||
return Navigator.of(Get.context!).push(
|
||||
HeroDialogRoute(
|
||||
builder: (context) => InteractiveviewerGallery(
|
||||
sources: imgList,
|
||||
initIndex: initialPage,
|
||||
onDismissed: onDismissed,
|
||||
setStatusBar: !noneSet,
|
||||
quality: quality ?? GlobalData().imgQuality,
|
||||
),
|
||||
),
|
||||
@@ -562,13 +557,13 @@ class PageUtils {
|
||||
duration: const Duration(milliseconds: 200),
|
||||
)..forward();
|
||||
key.currentState?.showBottomSheet(
|
||||
constraints: const BoxConstraints(),
|
||||
(context) {
|
||||
return FadeTransition(
|
||||
opacity: Tween<double>(begin: 0, end: 1).animate(ctr),
|
||||
child: InteractiveviewerGallery(
|
||||
sources: imgList.map((url) => SourceModel(url: url)).toList(),
|
||||
initIndex: index,
|
||||
setStatusBar: false,
|
||||
onClose: (value) async {
|
||||
if (!value) {
|
||||
try {
|
||||
|
||||
@@ -144,8 +144,6 @@ class ReplyUtils {
|
||||
type: type,
|
||||
sort: ReplySortType.time.index,
|
||||
page: 1,
|
||||
enableFilter: false,
|
||||
antiGoodsReply: false,
|
||||
);
|
||||
|
||||
if (res is Error) {
|
||||
@@ -168,8 +166,6 @@ class ReplyUtils {
|
||||
root: id,
|
||||
pageNum: 1,
|
||||
type: type,
|
||||
filterBanWord: false,
|
||||
antiGoodsReply: false,
|
||||
);
|
||||
|
||||
if (res1 is Error) {
|
||||
@@ -185,9 +181,7 @@ class ReplyUtils {
|
||||
root: id,
|
||||
pageNum: 1,
|
||||
type: type,
|
||||
filterBanWord: false,
|
||||
isCheck: true,
|
||||
antiGoodsReply: false,
|
||||
);
|
||||
|
||||
if (res2 is Error) {
|
||||
@@ -222,9 +216,7 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=$id&type=$typ
|
||||
root: root,
|
||||
pageNum: i,
|
||||
type: type,
|
||||
filterBanWord: false,
|
||||
isCheck: true,
|
||||
antiGoodsReply: false,
|
||||
);
|
||||
if (res3 is Error) {
|
||||
break;
|
||||
@@ -251,9 +243,7 @@ https://api.bilibili.com/x/v2/reply/reply?oid=$oid&pn=1&ps=20&root=$id&type=$typ
|
||||
root: root,
|
||||
pageNum: i,
|
||||
type: type,
|
||||
filterBanWord: false,
|
||||
isCheck: true,
|
||||
antiGoodsReply: false,
|
||||
);
|
||||
if (res4 is Error) {
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math' show pow, min, sqrt;
|
||||
import 'dart:math' show pow, sqrt;
|
||||
|
||||
import 'package:PiliPlus/common/widgets/pair.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
@@ -534,9 +534,8 @@ class Pref {
|
||||
static bool get optTabletNav =>
|
||||
_setting.get(SettingBoxKey.optTabletNav, defaultValue: true);
|
||||
|
||||
static bool get horizontalScreen {
|
||||
return _setting.get(SettingBoxKey.horizontalScreen) ?? isTablet;
|
||||
}
|
||||
static bool get horizontalScreen =>
|
||||
_setting.get(SettingBoxKey.horizontalScreen) ?? isTablet;
|
||||
|
||||
static bool get isTablet {
|
||||
bool isTablet;
|
||||
@@ -545,9 +544,9 @@ class Pref {
|
||||
} 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;
|
||||
isTablet = screenSize.shortestSide >= 600;
|
||||
}
|
||||
_setting.put(SettingBoxKey.horizontalScreen, isTablet);
|
||||
return isTablet;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user