mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-28 06:15:51 +08:00
@@ -5,7 +5,7 @@ import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/login_utils.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
|
||||
abstract class Accounts {
|
||||
abstract final class Accounts {
|
||||
static late final Box<LoginAccount> account;
|
||||
static final List<Account> accountMode = List.filled(
|
||||
AccountType.values.length,
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'dart:convert';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
abstract class AppSign {
|
||||
abstract final class AppSign {
|
||||
static void appSign(
|
||||
Map<String, dynamic> params, {
|
||||
String appkey = Constants.appKey,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
abstract class CacheManager {
|
||||
abstract final class CacheManager {
|
||||
// 获取缓存目录
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
static Future<int> loadApplicationCache([
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:intl/intl.dart' show DateFormat;
|
||||
|
||||
abstract class DateFormatUtils {
|
||||
abstract final class DateFormatUtils {
|
||||
static final shortFormat = DateFormat('MM-dd');
|
||||
static final longFormat = DateFormat('yyyy-MM-dd');
|
||||
static final _shortFormatD = DateFormat('MM-dd HH:mm');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
abstract class Em {
|
||||
abstract final class Em {
|
||||
static final _exp = RegExp('<[^>]*>([^<]*)</[^>]*>');
|
||||
static final _htmlRegExp = RegExp(r'&(lt|gt|quot|apos|nbsp|amp);');
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
abstract class FavUtils {
|
||||
abstract final class FavUtils {
|
||||
static bool isDefaultFav(int? attr) {
|
||||
if (attr == null) {
|
||||
return false;
|
||||
|
||||
@@ -16,7 +16,7 @@ mixin GridMixin<T extends StatefulWidget> on State<T> {
|
||||
);
|
||||
}
|
||||
|
||||
abstract class Grid {
|
||||
abstract final class Grid {
|
||||
static final double smallCardWidth = Pref.smallCardWidth;
|
||||
|
||||
static SliverGridDelegateWithExtentAndRatio videoCardHDelegate(
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'dart:convert';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:uuid/v4.dart';
|
||||
|
||||
abstract class IdUtils {
|
||||
abstract final class IdUtils {
|
||||
static const XOR_CODE = 23442827791579;
|
||||
static const MASK_CODE = 2251799813685247;
|
||||
static const MAX_AID = 1 << 51;
|
||||
|
||||
@@ -21,7 +21,7 @@ import 'package:live_photo_maker/live_photo_maker.dart';
|
||||
import 'package:saver_gallery/saver_gallery.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
abstract class ImageUtils {
|
||||
abstract final class ImageUtils {
|
||||
static String get time =>
|
||||
DateFormat('yyyy-MM-dd_HH-mm-ss').format(DateTime.now());
|
||||
static bool silentDownImg = Pref.silentDownImg;
|
||||
|
||||
@@ -35,7 +35,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart' hide ContextExtensionss;
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
abstract class PageUtils {
|
||||
abstract final class PageUtils {
|
||||
static final RouteObserver<PageRoute> routeObserver =
|
||||
RouteObserver<PageRoute>();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:PiliPlus/models/model_video.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
|
||||
class RecommendFilter {
|
||||
abstract final class RecommendFilter {
|
||||
static int minDurationForRcmd = Pref.minDurationForRcmd;
|
||||
static int minPlayForRcmd = Pref.minPlayForRcmd;
|
||||
static int minLikeRatioForRecommend = Pref.minLikeRatioForRecommend;
|
||||
|
||||
@@ -17,7 +17,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ReplyUtils {
|
||||
abstract final class ReplyUtils {
|
||||
static void onCheckReply({
|
||||
required ReplyInfo replyInfo,
|
||||
required bool biliSendCommAntifraud,
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
abstract class GStorage {
|
||||
abstract final class GStorage {
|
||||
static late final Box<UserInfoData> userInfo;
|
||||
static late final Box<dynamic> historyWord;
|
||||
static late final Box<dynamic> localCache;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// ignore_for_file: constant_identifier_names
|
||||
|
||||
abstract class SettingBoxKey {
|
||||
abstract final class SettingBoxKey {
|
||||
static const String btmProgressBehavior = 'btmProgressBehavior',
|
||||
defaultVideoQa = 'defaultVideoQa',
|
||||
defaultVideoQaCellular = 'defaultVideoQaCellular',
|
||||
@@ -224,7 +224,7 @@ abstract class SettingBoxKey {
|
||||
liveCdnUrl = 'liveCdnUrl';
|
||||
}
|
||||
|
||||
abstract class LocalCacheKey {
|
||||
abstract final class LocalCacheKey {
|
||||
static const String historyPause = 'historyPause',
|
||||
blackMids = 'blackMids',
|
||||
danmakuFilterRules = 'danmakuFilterRules',
|
||||
@@ -233,7 +233,7 @@ abstract class LocalCacheKey {
|
||||
buvid = 'buvid';
|
||||
}
|
||||
|
||||
abstract class VideoBoxKey {
|
||||
abstract final class VideoBoxKey {
|
||||
static const String playRepeat = 'playRepeat',
|
||||
playSpeedDefault = 'playSpeedDefault',
|
||||
longPressSpeedDefault = 'longPressSpeedDefault',
|
||||
|
||||
@@ -37,7 +37,7 @@ import 'package:get/get.dart' hide ContextExtensionss;
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
abstract class Pref {
|
||||
abstract final class Pref {
|
||||
static final Box _setting = GStorage.setting;
|
||||
static final Box _video = GStorage.video;
|
||||
static final Box _localCache = GStorage.localCache;
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
abstract class ThemeUtils {
|
||||
abstract final class ThemeUtils {
|
||||
static ThemeData getThemeData({
|
||||
required ColorScheme colorScheme,
|
||||
required bool isDynamic,
|
||||
@@ -91,6 +91,7 @@ abstract class ThemeUtils {
|
||||
fontWeight: fontWeight,
|
||||
),
|
||||
backgroundColor: colorScheme.surface,
|
||||
constraints: const BoxConstraints(minWidth: 280, maxWidth: 420),
|
||||
),
|
||||
bottomSheetTheme: BottomSheetThemeData(
|
||||
backgroundColor: colorScheme.surface,
|
||||
|
||||
@@ -15,7 +15,7 @@ import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
abstract class Update {
|
||||
abstract final class Update {
|
||||
// 检查更新
|
||||
static Future<void> checkUpdate([bool isAuto = true]) async {
|
||||
if (kDebugMode) return;
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
abstract class UrlUtils {
|
||||
abstract final class UrlUtils {
|
||||
// 302重定向路由截取
|
||||
static Future<String?> parseRedirectUrl(
|
||||
String url, [
|
||||
|
||||
@@ -14,7 +14,7 @@ import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
|
||||
abstract class Utils {
|
||||
abstract final class Utils {
|
||||
static final random = Random();
|
||||
|
||||
static const channel = MethodChannel(Constants.appName);
|
||||
|
||||
@@ -13,7 +13,7 @@ import 'package:crypto/crypto.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:synchronized/synchronized.dart';
|
||||
|
||||
abstract class WbiSign {
|
||||
abstract final class WbiSign {
|
||||
static Box localCache = GStorage.localCache;
|
||||
static final Lock lock = Lock();
|
||||
static final RegExp chrFilter = RegExp(r"[!\'\(\)\*]");
|
||||
|
||||
Reference in New Issue
Block a user