Merge branch 'fix'

This commit is contained in:
guozhigq
2024-11-11 22:27:34 +08:00
80 changed files with 127 additions and 129 deletions

View File

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
Box<dynamic> setting = GStrorage.setting; Box<dynamic> setting = GStorage.setting;
class CustomToast extends StatelessWidget { class CustomToast extends StatelessWidget {
const CustomToast({super.key, required this.msg}); const CustomToast({super.key, required this.msg});

View File

@ -6,7 +6,7 @@ import 'package:pilipala/utils/global_data_cache.dart';
import '../../utils/storage.dart'; import '../../utils/storage.dart';
import '../constants.dart'; import '../constants.dart';
Box<dynamic> setting = GStrorage.setting; Box<dynamic> setting = GStorage.setting;
class NetworkImgLayer extends StatelessWidget { class NetworkImgLayer extends StatelessWidget {
const NetworkImgLayer({ const NetworkImgLayer({

View File

@ -21,8 +21,8 @@ class Request {
static late CookieManager cookieManager; static late CookieManager cookieManager;
static late final Dio dio; static late final Dio dio;
factory Request() => _instance; factory Request() => _instance;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
static Box localCache = GStrorage.localCache; static Box localCache = GStorage.localCache;
late bool enableSystemProxy; late bool enableSystemProxy;
late String systemProxyHost; late String systemProxyHost;
late String systemProxyPort; late String systemProxyPort;
@ -32,8 +32,8 @@ class Request {
/// 设置cookie /// 设置cookie
static setCookie() async { static setCookie() async {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
final String cookiePath = await Utils.getCookiePath(); final String cookiePath = await Utils.getCookiePath();
final PersistCookieJar cookieJar = PersistCookieJar( final PersistCookieJar cookieJar = PersistCookieJar(
ignoreExpires: true, ignoreExpires: true,

View File

@ -470,8 +470,8 @@ class MemberHttp {
SmartDialog.dismiss(); SmartDialog.dismiss();
if (res.data['code'] == 0) { if (res.data['code'] == 0) {
String accessKey = res.data['data']['access_token']; String accessKey = res.data['data']['access_token'];
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
var userInfo = userInfoCache.get('userInfoCache'); var userInfo = userInfoCache.get('userInfoCache');
localCache.put( localCache.put(
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey}); LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});

View File

@ -11,7 +11,7 @@ import '../utils/storage.dart';
import 'index.dart'; import 'index.dart';
class SearchHttp { class SearchHttp {
static Box setting = GStrorage.setting; static Box setting = GStorage.setting;
static Future hotSearchList() async { static Future hotSearchList() async {
var res = await Request().get(Api.hotSearchList); var res = await Request().get(Api.hotSearchList);
if (res.data is String) { if (res.data is String) {

View File

@ -25,11 +25,11 @@ import 'init.dart';
/// 返回{'status': bool, 'data': List} /// 返回{'status': bool, 'data': List}
/// view层根据 status 判断渲染逻辑 /// view层根据 status 判断渲染逻辑
class VideoHttp { class VideoHttp {
static Box localCache = GStrorage.localCache; static Box localCache = GStorage.localCache;
static Box setting = GStrorage.setting; static Box setting = GStorage.setting;
static bool enableRcmdDynamic = static bool enableRcmdDynamic =
setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true); setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true);
static Box userInfoCache = GStrorage.userInfo; static Box userInfoCache = GStorage.userInfo;
// 首页推荐视频 // 首页推荐视频
static Future rcmdVideoList({required int ps, required int freshIdx}) async { static Future rcmdVideoList({required int ps, required int freshIdx}) async {

View File

@ -32,7 +32,7 @@ void main() async {
MediaKit.ensureInitialized(); MediaKit.ensureInitialized();
await SystemChrome.setPreferredOrientations( await SystemChrome.setPreferredOrientations(
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
await GStrorage.init(); await GStorage.init();
clearLogs(); clearLogs();
Request(); Request();
await Request.setCookie(); await Request.setCookie();
@ -73,7 +73,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
// 主题色 // 主题色
Color defaultColor = Color defaultColor =
colorThemeTypes[setting.get(SettingBoxKey.customColor, defaultValue: 0)] colorThemeTypes[setting.get(SettingBoxKey.customColor, defaultValue: 0)]

View File

@ -29,7 +29,7 @@ class ReplyMember {
avatar = json['avatar']; avatar = json['avatar'];
level = json['level_info']['current_level']; level = json['level_info']['current_level'];
pendant = Pendant.fromJson(json['pendant']); pendant = Pendant.fromJson(json['pendant']);
officialVerify = json['officia_verify']; officialVerify = json['official_verify'];
vip = json['vip']; vip = json['vip'];
fansDetail = json['fans_detail']; fansDetail = json['fans_detail'];
userSailing = json['user_sailing'] != null userSailing = json['user_sailing'] != null

View File

@ -12,7 +12,7 @@ class BangumiController extends GetxController {
RxInt total = 0.obs; RxInt total = 0.obs;
int _currentPage = 1; int _currentPage = 1;
bool isLoadingMore = true; bool isLoadingMore = true;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
RxBool userLogin = false.obs; RxBool userLogin = false.obs;
late int mid; late int mid;
var userInfo; var userInfo;

View File

@ -48,7 +48,7 @@ class BangumiIntroController extends GetxController {
RxBool hasCoin = false.obs; RxBool hasCoin = false.obs;
// 是否收藏 // 是否收藏
RxBool hasFav = false.obs; RxBool hasFav = false.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
bool userLogin = false; bool userLogin = false;
Rx<FavFolderData> favFolderData = FavFolderData().obs; Rx<FavFolderData> favFolderData = FavFolderData().obs;
List addMediaIdsNew = []; List addMediaIdsNew = [];

View File

@ -116,7 +116,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
String heroTag = Get.arguments['heroTag']; String heroTag = Get.arguments['heroTag'];
late final BangumiIntroController bangumiIntroController; late final BangumiIntroController bangumiIntroController;
late final VideoDetailController videoDetailCtr; late final VideoDetailController videoDetailCtr;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
late double sheetHeight; late double sheetHeight;
int? cid; int? cid;
bool isProcessing = false; bool isProcessing = false;

View File

@ -4,7 +4,7 @@ import 'package:pilipala/common/widgets/stat/danmu.dart';
import 'package:pilipala/common/widgets/stat/view.dart'; import 'package:pilipala/common/widgets/stat/view.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
late double sheetHeight; late double sheetHeight;
class IntroDetail extends StatelessWidget { class IntroDetail extends StatelessWidget {

View File

@ -36,7 +36,7 @@ class BangumiPanel extends StatefulWidget {
class _BangumiPanelState extends State<BangumiPanel> { class _BangumiPanelState extends State<BangumiPanel> {
late RxInt currentIndex = (-1).obs; late RxInt currentIndex = (-1).obs;
final ScrollController listViewScrollCtr = ScrollController(); final ScrollController listViewScrollCtr = ScrollController();
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
dynamic userInfo; dynamic userInfo;
// 默认未开通 // 默认未开通
int vipStatus = 0; int vipStatus = 0;

View File

@ -22,7 +22,7 @@ class _BlackListPageState extends State<BlackListPage> {
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
Future? _futureBuilderFuture; Future? _futureBuilderFuture;
bool _isLoadingMore = false; bool _isLoadingMore = false;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
@override @override
void initState() { void initState() {

View File

@ -32,7 +32,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
late PlDanmakuController _plDanmakuController; late PlDanmakuController _plDanmakuController;
DanmakuController? _controller; DanmakuController? _controller;
// bool danmuPlayStatus = true; // bool danmuPlayStatus = true;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late bool enableShowDanmaku; late bool enableShowDanmaku;
late List blockTypes; late List blockTypes;
late double showArea; late double showArea;

View File

@ -50,11 +50,11 @@ class DynamicsController extends GetxController {
]; ];
bool flag = false; bool flag = false;
RxInt initialValue = 0.obs; RxInt initialValue = 0.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
RxBool userLogin = false.obs; RxBool userLogin = false.obs;
var userInfo; var userInfo;
RxBool isLoadingDynamic = false.obs; RxBool isLoadingDynamic = false.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
@override @override
void onInit() { void onInit() {

View File

@ -24,7 +24,7 @@ class DynamicDetailController extends GetxController {
ReplySortType _sortType = ReplySortType.time; ReplySortType _sortType = ReplySortType.time;
RxString sortTypeTitle = ReplySortType.time.titles.obs; RxString sortTypeTitle = ReplySortType.time.titles.obs;
RxString sortTypeLabel = ReplySortType.time.labels.obs; RxString sortTypeLabel = ReplySortType.time.labels.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
RxInt replyReqCode = 200.obs; RxInt replyReqCode = 200.obs;
bool isEnd = false; bool isEnd = false;
@ -37,13 +37,13 @@ class DynamicDetailController extends GetxController {
acount.value = acount.value =
int.parse(item!.modules!.moduleStat!.comment!.count ?? '0'); int.parse(item!.modules!.moduleStat!.comment!.count ?? '0');
} }
int deaultReplySortIndex = int defaultReplySortIndex =
setting.get(SettingBoxKey.replySortType, defaultValue: 0); setting.get(SettingBoxKey.replySortType, defaultValue: 0);
if (deaultReplySortIndex == 2) { if (defaultReplySortIndex == 2) {
setting.put(SettingBoxKey.replySortType, 0); setting.put(SettingBoxKey.replySortType, 0);
deaultReplySortIndex = 0; defaultReplySortIndex = 0;
} }
_sortType = ReplySortType.values[deaultReplySortIndex]; _sortType = ReplySortType.values[defaultReplySortIndex];
sortTypeTitle.value = _sortType.titles; sortTypeTitle.value = _sortType.titles;
sortTypeLabel.value = _sortType.labels; sortTypeLabel.value = _sortType.labels;
} }

View File

@ -32,7 +32,7 @@ class _DynamicsPageState extends State<DynamicsPage>
final MineController mineController = Get.put(MineController()); final MineController mineController = Get.put(MineController());
late Future _futureBuilderFuture; late Future _futureBuilderFuture;
late Future _futureBuilderFutureUp; late Future _futureBuilderFutureUp;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
late ScrollController scrollController; late ScrollController scrollController;
@override @override

View File

@ -6,7 +6,7 @@ import 'package:pilipala/models/fans/result.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
class FansController extends GetxController { class FansController extends GetxController {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
int pn = 1; int pn = 1;
int ps = 20; int ps = 20;
int total = 0; int total = 0;

View File

@ -11,7 +11,7 @@ class FavController extends GetxController {
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
Rx<FavFolderData> favFolderData = FavFolderData().obs; Rx<FavFolderData> favFolderData = FavFolderData().obs;
RxList<FavFolderItemData> favFolderList = <FavFolderItemData>[].obs; RxList<FavFolderItemData> favFolderList = <FavFolderItemData>[].obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
UserInfoData? userInfo; UserInfoData? userInfo;
int currentPage = 1; int currentPage = 1;
int pageSize = 60; int pageSize = 60;

View File

@ -11,7 +11,7 @@ import 'package:pilipala/utils/storage.dart';
/// 查看自己的关注时,可以查看分类 /// 查看自己的关注时,可以查看分类
/// 查看其他人的关注时,只可以看全部 /// 查看其他人的关注时,只可以看全部
class FollowController extends GetxController with GetTickerProviderStateMixin { class FollowController extends GetxController with GetTickerProviderStateMixin {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
int pn = 1; int pn = 1;
int ps = 20; int ps = 20;
int total = 0; int total = 0;

View File

@ -12,11 +12,11 @@ class HistoryController extends GetxController {
RxList<HisListItem> historyList = <HisListItem>[].obs; RxList<HisListItem> historyList = <HisListItem>[].obs;
RxBool isLoadingMore = false.obs; RxBool isLoadingMore = false.obs;
RxBool pauseStatus = false.obs; RxBool pauseStatus = false.obs;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
RxBool isLoading = false.obs; RxBool isLoading = false.obs;
RxBool enableMultiple = false.obs; RxBool enableMultiple = false.obs;
RxInt checkedCount = 0.obs; RxInt checkedCount = 0.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
UserInfoData? userInfo; UserInfoData? userInfo;
@override @override

View File

@ -14,12 +14,12 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
late TabController tabController; late TabController tabController;
late List tabsCtrList; late List tabsCtrList;
late List<Widget> tabsPageList; late List<Widget> tabsPageList;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
Box settingStorage = GStrorage.setting; Box settingStorage = GStorage.setting;
RxBool userLogin = false.obs; RxBool userLogin = false.obs;
RxString userFace = ''.obs; RxString userFace = ''.obs;
var userInfo; var userInfo;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late final StreamController<bool> searchBarStream = late final StreamController<bool> searchBarStream =
StreamController<bool>.broadcast(); StreamController<bool>.broadcast();
late bool hideSearchBar; late bool hideSearchBar;

View File

@ -5,7 +5,7 @@ import 'package:hive/hive.dart';
import 'package:pilipala/common/widgets/network_img_layer.dart'; import 'package:pilipala/common/widgets/network_img_layer.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
class HomeAppBar extends StatelessWidget { class HomeAppBar extends StatelessWidget {
const HomeAppBar({super.key}); const HomeAppBar({super.key});

View File

@ -25,7 +25,7 @@ class HtmlRenderController extends GetxController {
ReplySortType _sortType = ReplySortType.time; ReplySortType _sortType = ReplySortType.time;
RxString sortTypeTitle = ReplySortType.time.titles.obs; RxString sortTypeTitle = ReplySortType.time.titles.obs;
RxString sortTypeLabel = ReplySortType.time.labels.obs; RxString sortTypeLabel = ReplySortType.time.labels.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
@override @override
void onInit() { void onInit() {

View File

@ -13,7 +13,7 @@ class LaterController extends GetxController {
RxList<HotVideoItemModel> laterList = <HotVideoItemModel>[].obs; RxList<HotVideoItemModel> laterList = <HotVideoItemModel>[].obs;
int count = 0; int count = 0;
RxBool isLoading = false.obs; RxBool isLoading = false.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
UserInfoData? userInfo; UserInfoData? userInfo;
@override @override

View File

@ -17,7 +17,7 @@ class LiveController extends GetxController {
RxInt liveFollowingCount = 0.obs; RxInt liveFollowingCount = 0.obs;
bool flag = false; bool flag = false;
OverlayEntry? popupDialog; OverlayEntry? popupDialog;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
@override @override
void onInit() { void onInit() {

View File

@ -7,7 +7,7 @@ import 'package:pilipala/utils/storage.dart';
class LiveFollowController extends GetxController { class LiveFollowController extends GetxController {
RxInt crossAxisCount = 2.obs; RxInt crossAxisCount = 2.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
int _currentPage = 1; int _currentPage = 1;
RxInt liveFollowingCount = 0.obs; RxInt liveFollowingCount = 0.obs;
RxList<LiveFollowingItemModel> liveFollowingList = RxList<LiveFollowingItemModel> liveFollowingList =

View File

@ -33,7 +33,7 @@ class LiveRoomController extends GetxController {
int? tempCurrentQn; int? tempCurrentQn;
late List<Map<String, dynamic>> acceptQnList; late List<Map<String, dynamic>> acceptQnList;
RxString currentQnDesc = ''.obs; RxString currentQnDesc = ''.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
int userId = 0; int userId = 0;
PlSocket? plSocket; PlSocket? plSocket;
List<String> danmuHostList = []; List<String> danmuHostList = [];

View File

@ -35,7 +35,7 @@ class _BottomControlState extends State<BottomControl> {
TextStyle subTitleStyle = const TextStyle(fontSize: 12); TextStyle subTitleStyle = const TextStyle(fontSize: 12);
TextStyle titleStyle = const TextStyle(fontSize: 14); TextStyle titleStyle = const TextStyle(fontSize: 14);
Size get preferredSize => const Size(double.infinity, kToolbarHeight); Size get preferredSize => const Size(double.infinity, kToolbarHeight);
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
@override @override
void initState() { void initState() {

View File

@ -20,12 +20,12 @@ class MainController extends GetxController {
late List<int> navBarSort; late List<int> navBarSort;
final StreamController<bool> bottomBarStream = final StreamController<bool> bottomBarStream =
StreamController<bool>.broadcast(); StreamController<bool>.broadcast();
Box setting = GStrorage.setting; Box setting = GStorage.setting;
DateTime? _lastPressedAt; DateTime? _lastPressedAt;
late bool hideTabBar; late bool hideTabBar;
late PageController pageController; late PageController pageController;
int selectedIndex = 0; int selectedIndex = 0;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
dynamic userInfo; dynamic userInfo;
RxBool userLogin = false.obs; RxBool userLogin = false.obs;
late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs; late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;

View File

@ -30,7 +30,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
late MineController _mineController; late MineController _mineController;
int? _lastSelectTime; //上次点击时间 int? _lastSelectTime; //上次点击时间
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late bool enableMYBar; late bool enableMYBar;
@override @override
@ -113,14 +113,14 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
@override @override
void dispose() async { void dispose() async {
await GStrorage.close(); await GStorage.close();
EventBus().off(EventName.loginEvent); EventBus().off(EventName.loginEvent);
super.dispose(); super.dispose();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
double statusBarHeight = MediaQuery.of(context).padding.top; double statusBarHeight = MediaQuery.of(context).padding.top;
double sheetHeight = MediaQuery.sizeOf(context).height - double sheetHeight = MediaQuery.sizeOf(context).height -
MediaQuery.of(context).padding.top - MediaQuery.of(context).padding.top -

View File

@ -18,7 +18,7 @@ class MemberController extends GetxController {
late Map userStat; late Map userStat;
RxString face = ''.obs; RxString face = ''.obs;
String? heroTag; String? heroTag;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
late int ownerMid; late int ownerMid;
// 投稿列表 // 投稿列表
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs; RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;

View File

@ -17,8 +17,8 @@ class MineController extends GetxController {
Rx<UserInfoData> userInfo = UserInfoData().obs; Rx<UserInfoData> userInfo = UserInfoData().obs;
Rx<ThemeType> themeType = ThemeType.system.obs; Rx<ThemeType> themeType = ThemeType.system.obs;
Rx<FavFolderData> favFolderData = FavFolderData().obs; Rx<FavFolderData> favFolderData = FavFolderData().obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
List menuList = [ List menuList = [
{ {
'icon': Icons.history, 'icon': Icons.history,

View File

@ -6,7 +6,7 @@ import 'package:pilipala/http/user.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
class MineEditController extends GetxController { class MineEditController extends GetxController {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
final formKey = GlobalKey<FormState>(); final formKey = GlobalKey<FormState>();
final TextEditingController unameCtr = TextEditingController(); final TextEditingController unameCtr = TextEditingController();
final TextEditingController useridCtr = TextEditingController(); final TextEditingController useridCtr = TextEditingController();

View File

@ -14,7 +14,7 @@ class RankController extends GetxController with GetTickerProviderStateMixin {
late TabController tabController; late TabController tabController;
late List tabsCtrList; late List tabsCtrList;
late List<Widget> tabsPageList; late List<Widget> tabsPageList;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late final StreamController<bool> searchBarStream = late final StreamController<bool> searchBarStream =
StreamController<bool>.broadcast(); StreamController<bool>.broadcast();

View File

@ -14,7 +14,7 @@ class RcmdController extends GetxController {
// RxList<RecVideoItemModel> webVideoList = <RecVideoItemModel>[].obs; // RxList<RecVideoItemModel> webVideoList = <RecVideoItemModel>[].obs;
bool isLoadingMore = true; bool isLoadingMore = true;
OverlayEntry? popupDialog; OverlayEntry? popupDialog;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
RxInt crossAxisCount = 2.obs; RxInt crossAxisCount = 2.obs;
late bool enableSaveLastData; late bool enableSaveLastData;
late String defaultRcmdType = 'web'; late String defaultRcmdType = 'web';

View File

@ -15,7 +15,7 @@ class SSearchController extends GetxController {
RxString searchKeyWord = ''.obs; RxString searchKeyWord = ''.obs;
Rx<TextEditingController> controller = TextEditingController().obs; Rx<TextEditingController> controller = TextEditingController().obs;
RxList<HotSearchItem> hotSearchList = <HotSearchItem>[].obs; RxList<HotSearchItem> hotSearchList = <HotSearchItem>[].obs;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
List historyCacheList = []; List historyCacheList = [];
RxList historyList = [].obs; RxList historyList = [].obs;
RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs; RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs;
@ -23,7 +23,7 @@ class SSearchController extends GetxController {
Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间 Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间
String hintText = '搜索'; String hintText = '搜索';
RxString defaultSearch = ''.obs; RxString defaultSearch = ''.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
bool enableHotKey = true; bool enableHotKey = true;
bool enableSearchSuggest = true; bool enableSearchSuggest = true;

View File

@ -13,9 +13,9 @@ import '../main/index.dart';
import 'widgets/select_dialog.dart'; import 'widgets/select_dialog.dart';
class SettingController extends GetxController { class SettingController extends GetxController {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
RxBool userLogin = false.obs; RxBool userLogin = false.obs;
RxBool feedBackEnable = false.obs; RxBool feedBackEnable = false.obs;

View File

@ -19,8 +19,8 @@ class ExtraSetting extends StatefulWidget {
} }
class _ExtraSettingState extends State<ExtraSetting> { class _ExtraSettingState extends State<ExtraSetting> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
static Box localCache = GStrorage.localCache; static Box localCache = GStorage.localCache;
late dynamic defaultReplySort; late dynamic defaultReplySort;
late dynamic defaultDynamicType; late dynamic defaultDynamicType;
late dynamic enableSystemProxy; late dynamic enableSystemProxy;

View File

@ -13,7 +13,7 @@ class ActionMenuSetPage extends StatefulWidget {
} }
class _ActionMenuSetPageState extends State<ActionMenuSetPage> { class _ActionMenuSetPageState extends State<ActionMenuSetPage> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late List<String> actionTypeSort; late List<String> actionTypeSort;
late List<Map> allLabels; late List<Map> allLabels;

View File

@ -142,7 +142,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
} }
class ColorSelectController extends GetxController { class ColorSelectController extends GetxController {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
RxBool dynamicColor = true.obs; RxBool dynamicColor = true.obs;
RxInt type = 0.obs; RxInt type = 0.obs;
late final List<Map<String, dynamic>> colorThemes; late final List<Map<String, dynamic>> colorThemes;

View File

@ -16,7 +16,7 @@ class _SetDiaplayModeState extends State<SetDiaplayMode> {
List<DisplayMode> modes = <DisplayMode>[]; List<DisplayMode> modes = <DisplayMode>[];
DisplayMode? active; DisplayMode? active;
DisplayMode? preferred; DisplayMode? preferred;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
final ValueNotifier<int> page = ValueNotifier<int>(0); final ValueNotifier<int> page = ValueNotifier<int>(0);
late final PageController controller = PageController() late final PageController controller = PageController()

View File

@ -11,7 +11,7 @@ class FontSizeSelectPage extends StatefulWidget {
} }
class _FontSizeSelectPageState extends State<FontSizeSelectPage> { class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
List<double> list = [0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3]; List<double> list = [0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3];
late double minsize; late double minsize;
late double maxSize; late double maxSize;

View File

@ -12,7 +12,7 @@ class TabbarSetPage extends StatefulWidget {
} }
class _TabbarSetPageState extends State<TabbarSetPage> { class _TabbarSetPageState extends State<TabbarSetPage> {
Box settingStorage = GStrorage.setting; Box settingStorage = GStorage.setting;
late List defaultTabs; late List defaultTabs;
late List<String> tabbarSort; late List<String> tabbarSort;

View File

@ -13,7 +13,7 @@ class NavigationBarSetPage extends StatefulWidget {
} }
class _NavigationbarSetPageState extends State<NavigationBarSetPage> { class _NavigationbarSetPageState extends State<NavigationBarSetPage> {
Box settingStorage = GStrorage.setting; Box settingStorage = GStorage.setting;
late List defaultNavTabs; late List defaultNavTabs;
late List<int> navBarSort; late List<int> navBarSort;

View File

@ -16,7 +16,7 @@ class PlayGesturePage extends StatefulWidget {
} }
class _PlayGesturePageState extends State<PlayGesturePage> { class _PlayGesturePageState extends State<PlayGesturePage> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late int fullScreenGestureMode; late int fullScreenGestureMode;
@override @override

View File

@ -14,8 +14,8 @@ class PlaySpeedPage extends StatefulWidget {
} }
class _PlaySpeedPageState extends State<PlaySpeedPage> { class _PlaySpeedPageState extends State<PlaySpeedPage> {
Box videoStorage = GStrorage.video; Box videoStorage = GStorage.video;
Box settingStorage = GStrorage.setting; Box settingStorage = GStorage.setting;
late double playSpeedDefault; late double playSpeedDefault;
late List<double> playSpeedSystem; late List<double> playSpeedSystem;
late double longPressSpeedDefault; late double longPressSpeedDefault;

View File

@ -23,7 +23,7 @@ class PlaySetting extends StatefulWidget {
} }
class _PlaySettingState extends State<PlaySetting> { class _PlaySettingState extends State<PlaySetting> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late dynamic defaultVideoQa; late dynamic defaultVideoQa;
late dynamic defaultLiveQa; late dynamic defaultLiveQa;
late dynamic defaultAudioQa; late dynamic defaultAudioQa;

View File

@ -14,7 +14,7 @@ class PrivacySetting extends StatefulWidget {
class _PrivacySettingState extends State<PrivacySetting> { class _PrivacySettingState extends State<PrivacySetting> {
bool userLogin = false; bool userLogin = false;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
var userInfo; var userInfo;
@override @override

View File

@ -17,10 +17,10 @@ class RecommendSetting extends StatefulWidget {
} }
class _RecommendSettingState extends State<RecommendSetting> { class _RecommendSettingState extends State<RecommendSetting> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
static Box localCache = GStrorage.localCache; static Box localCache = GStorage.localCache;
late dynamic defaultRcmdType; late dynamic defaultRcmdType;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
late dynamic userInfo; late dynamic userInfo;
bool userLogin = false; bool userLogin = false;
late dynamic accessKeyInfo; late dynamic accessKeyInfo;
@ -247,10 +247,9 @@ class _RecommendSettingState extends State<RecommendSetting> {
'* 其它(如热门视频、手动搜索、链接跳转等)均不受过滤器影响。\n' '* 其它(如热门视频、手动搜索、链接跳转等)均不受过滤器影响。\n'
'* 设定较严苛的条件可导致推荐项数锐减或多次请求,请酌情选择。\n' '* 设定较严苛的条件可导致推荐项数锐减或多次请求,请酌情选择。\n'
'* 后续可能会增加更多过滤条件,敬请期待。', '* 后续可能会增加更多过滤条件,敬请期待。',
style: Theme.of(context) style: Theme.of(context).textTheme.labelSmall!.copyWith(
.textTheme color:
.labelSmall! Theme.of(context).colorScheme.outline.withOpacity(0.7)),
.copyWith(color: Theme.of(context).colorScheme.outline.withOpacity(0.7)),
), ),
) )
], ],

View File

@ -28,7 +28,7 @@ class _StyleSettingState extends State<StyleSetting> {
final ColorSelectController colorSelectController = final ColorSelectController colorSelectController =
Get.put(ColorSelectController()); Get.put(ColorSelectController());
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late int picQuality; late int picQuality;
late ThemeType _tempThemeValue; late ThemeType _tempThemeValue;
late dynamic defaultCustomRows; late dynamic defaultCustomRows;

View File

@ -19,7 +19,7 @@ class SetSelectItem extends StatefulWidget {
} }
class _SetSelectItemState extends State<SetSelectItem> { class _SetSelectItemState extends State<SetSelectItem> {
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late dynamic currentVal; late dynamic currentVal;
late int currentIndex; late int currentIndex;
late List menus; late List menus;

View File

@ -28,7 +28,7 @@ class SetSwitchItem extends StatefulWidget {
class _SetSwitchItemState extends State<SetSwitchItem> { class _SetSwitchItemState extends State<SetSwitchItem> {
// ignore: non_constant_identifier_names // ignore: non_constant_identifier_names
Box Setting = GStrorage.setting; Box Setting = GStorage.setting;
late bool val; late bool val;
@override @override

View File

@ -11,7 +11,7 @@ import '../../models/user/sub_folder.dart';
class SubController extends GetxController { class SubController extends GetxController {
final ScrollController scrollController = ScrollController(); final ScrollController scrollController = ScrollController();
Rx<SubFolderModelData> subFolderData = SubFolderModelData().obs; Rx<SubFolderModelData> subFolderData = SubFolderModelData().obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
UserInfoData? userInfo; UserInfoData? userInfo;
int currentPage = 1; int currentPage = 1;
int pageSize = 20; int pageSize = 20;

View File

@ -71,9 +71,9 @@ class VideoDetailController extends GetxController
RxBool enableHA = false.obs; RxBool enableHA = false.obs;
/// 本地存储 /// 本地存储
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
RxInt oid = 0.obs; RxInt oid = 0.obs;
// 评论id 请求楼中楼评论使用 // 评论id 请求楼中楼评论使用

View File

@ -41,7 +41,7 @@ class VideoIntroController extends GetxController {
RxBool hasFav = false.obs; RxBool hasFav = false.obs;
// 是否不喜欢 // 是否不喜欢
RxBool hasDisLike = false.obs; RxBool hasDisLike = false.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
bool userLogin = false; bool userLogin = false;
Rx<FavFolderData> favFolderData = FavFolderData().obs; Rx<FavFolderData> favFolderData = FavFolderData().obs;
List addMediaIdsNew = []; List addMediaIdsNew = [];

View File

@ -137,8 +137,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
late String heroTag; late String heroTag;
late final VideoIntroController videoIntroController; late final VideoIntroController videoIntroController;
late final VideoDetailController videoDetailCtr; late final VideoDetailController videoDetailCtr;
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
final Box<dynamic> setting = GStrorage.setting; final Box<dynamic> setting = GStorage.setting;
late double sheetHeight; late double sheetHeight;
late final dynamic owner; late final dynamic owner;
late int mid; late int mid;

View File

@ -16,7 +16,7 @@ class FavPanel extends StatefulWidget {
} }
class _FavPanelState extends State<FavPanel> { class _FavPanelState extends State<FavPanel> {
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
late Future _futureBuilderFuture; late Future _futureBuilderFuture;
@override @override

View File

@ -18,7 +18,7 @@ class GroupPanel extends StatefulWidget {
} }
class _GroupPanelState extends State<GroupPanel> { class _GroupPanelState extends State<GroupPanel> {
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
late Future _futureBuilderFuture; late Future _futureBuilderFuture;
late List<MemberTagItemModel> tagsList; late List<MemberTagItemModel> tagsList;
bool showDefault = true; bool showDefault = true;

View File

@ -32,20 +32,20 @@ class VideoReplyController extends GetxController {
RxString sortTypeTitle = ReplySortType.time.titles.obs; RxString sortTypeTitle = ReplySortType.time.titles.obs;
RxString sortTypeLabel = ReplySortType.time.labels.obs; RxString sortTypeLabel = ReplySortType.time.labels.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
RxInt replyReqCode = 200.obs; RxInt replyReqCode = 200.obs;
bool isEnd = false; bool isEnd = false;
@override @override
void onInit() { void onInit() {
super.onInit(); super.onInit();
int deaultReplySortIndex = int defaultReplySortIndex =
setting.get(SettingBoxKey.replySortType, defaultValue: 0) as int; setting.get(SettingBoxKey.replySortType, defaultValue: 0) as int;
if (deaultReplySortIndex == 2) { if (defaultReplySortIndex == 2) {
setting.put(SettingBoxKey.replySortType, 0); setting.put(SettingBoxKey.replySortType, 0);
deaultReplySortIndex = 0; defaultReplySortIndex = 0;
} }
_sortType = ReplySortType.values[deaultReplySortIndex]; _sortType = ReplySortType.values[defaultReplySortIndex];
sortTypeTitle.value = _sortType.titles; sortTypeTitle.value = _sortType.titles;
sortTypeLabel.value = _sortType.labels; sortTypeLabel.value = _sortType.labels;
} }

View File

@ -26,7 +26,7 @@ import 'package:pilipala/utils/utils.dart';
import 'reply_save.dart'; import 'reply_save.dart';
import 'zan.dart'; import 'zan.dart';
Box setting = GStrorage.setting; Box setting = GStorage.setting;
class ReplyItem extends StatelessWidget { class ReplyItem extends StatelessWidget {
const ReplyItem({ const ReplyItem({

View File

@ -42,7 +42,7 @@ class VideoReplyReplyPanel extends StatefulWidget {
class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> { class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
late VideoReplyReplyController _videoReplyReplyController; late VideoReplyReplyController _videoReplyReplyController;
late AnimationController replyAnimationCtl; late AnimationController replyAnimationCtl;
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
Future? _futureBuilderFuture; Future? _futureBuilderFuture;
late ScrollController scrollController; late ScrollController scrollController;

View File

@ -54,8 +54,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
Rx<PlayerStatus> playerStatus = PlayerStatus.playing.obs; Rx<PlayerStatus> playerStatus = PlayerStatus.playing.obs;
double doubleOffset = 0; double doubleOffset = 0;
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
final Box<dynamic> setting = GStrorage.setting; final Box<dynamic> setting = GStorage.setting;
late double statusBarHeight; late double statusBarHeight;
final double videoHeight = Get.size.width * 9 / 16; final double videoHeight = Get.size.width * 9 / 16;
late Future _futureBuilderFuture; late Future _futureBuilderFuture;

View File

@ -52,8 +52,8 @@ class _HeaderControlState extends State<HeaderControl> {
static const TextStyle subTitleStyle = TextStyle(fontSize: 12); static const TextStyle subTitleStyle = TextStyle(fontSize: 12);
static const TextStyle titleStyle = TextStyle(fontSize: 14); static const TextStyle titleStyle = TextStyle(fontSize: 14);
Size get preferredSize => const Size(double.infinity, kToolbarHeight); Size get preferredSize => const Size(double.infinity, kToolbarHeight);
final Box<dynamic> localCache = GStrorage.localCache; final Box<dynamic> localCache = GStorage.localCache;
final Box<dynamic> videoStorage = GStrorage.video; final Box<dynamic> videoStorage = GStorage.video;
late List<double> speedsList; late List<double> speedsList;
double buttonSpace = 8; double buttonSpace = 8;
RxBool isFullScreen = false.obs; RxBool isFullScreen = false.obs;

View File

@ -20,7 +20,7 @@ class WhisperDetailController extends GetxController {
//表情转换图片规则 //表情转换图片规则
RxList<dynamic> eInfos = [].obs; RxList<dynamic> eInfos = [].obs;
final TextEditingController replyContentController = TextEditingController(); final TextEditingController replyContentController = TextEditingController();
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
List emoteList = []; List emoteList = [];
List<String> picList = []; List<String> picList = [];

View File

@ -30,7 +30,7 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
late double emoteHeight = 230.0; late double emoteHeight = 230.0;
double keyboardHeight = 0.0; // 键盘高度 double keyboardHeight = 0.0; // 键盘高度
RxString toolbarType = ''.obs; RxString toolbarType = ''.obs;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
@override @override
void initState() { void initState() {

View File

@ -56,8 +56,7 @@ class ChatItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isOwner = bool isOwner = item.senderUid == GStorage.userInfo.get('userInfoCache').mid;
item.senderUid == GStrorage.userInfo.get('userInfoCache').mid;
bool isPic = item.msgType == MsgType.pic.value; // 图片 bool isPic = item.msgType == MsgType.pic.value; // 图片
bool isText = item.msgType == MsgType.text.value; // 文本 bool isText = item.msgType == MsgType.text.value; // 文本

View File

@ -27,9 +27,9 @@ import '../../models/video/subTitile/content.dart';
import '../../models/video/subTitile/result.dart'; import '../../models/video/subTitile/result.dart';
// import 'package:wakelock_plus/wakelock_plus.dart'; // import 'package:wakelock_plus/wakelock_plus.dart';
Box videoStorage = GStrorage.video; Box videoStorage = GStorage.video;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
class PlPlayerController { class PlPlayerController {
Player? _videoPlayerController; Player? _videoPlayerController;

View File

@ -82,7 +82,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
final RxDouble _distance = 0.0.obs; final RxDouble _distance = 0.0.obs;
final RxBool _volumeInterceptEventStream = false.obs; final RxBool _volumeInterceptEventStream = false.obs;
Box setting = GStrorage.setting; Box setting = GStorage.setting;
late FullScreenMode mode; late FullScreenMode mode;
late int defaultBtmProgressBehavior; late int defaultBtmProgressBehavior;
late bool enableQuickDouble; late bool enableQuickDouble;

View File

@ -66,7 +66,7 @@ import '../pages/whisper/index.dart';
import '../pages/whisper_detail/index.dart'; import '../pages/whisper_detail/index.dart';
import '../utils/storage.dart'; import '../utils/storage.dart';
Box<dynamic> setting = GStrorage.setting; Box<dynamic> setting = GStorage.setting;
class Routes { class Routes {
static final List<GetPage<dynamic>> getPages = [ static final List<GetPage<dynamic>> getPages = [

View File

@ -24,7 +24,7 @@ Future<VideoPlayerServiceHandler> initAudioService() async {
class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler { class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
static final List<MediaItem> _item = []; static final List<MediaItem> _item = [];
Box setting = GStrorage.setting; Box setting = GStorage.setting;
bool enableBackgroundPlay = false; bool enableBackgroundPlay = false;
PlPlayerController player = PlPlayerController(); PlPlayerController player = PlPlayerController();

View File

@ -9,7 +9,7 @@ void DisableBatteryOpt() async {
} }
// 本地缓存中读取 是否禁用了电池优化 默认未禁用 // 本地缓存中读取 是否禁用了电池优化 默认未禁用
bool isDisableBatteryOptLocal = bool isDisableBatteryOptLocal =
GStrorage.localCache.get('isDisableBatteryOptLocal', defaultValue: false); GStorage.localCache.get('isDisableBatteryOptLocal', defaultValue: false);
if (!isDisableBatteryOptLocal) { if (!isDisableBatteryOptLocal) {
final isBatteryOptimizationDisabled = final isBatteryOptimizationDisabled =
await DisableBatteryOptimization.isBatteryOptimizationDisabled; await DisableBatteryOptimization.isBatteryOptimizationDisabled;
@ -17,11 +17,11 @@ void DisableBatteryOpt() async {
final hasDisabled = await DisableBatteryOptimization final hasDisabled = await DisableBatteryOptimization
.showDisableBatteryOptimizationSettings(); .showDisableBatteryOptimizationSettings();
// 设置为已禁用 // 设置为已禁用
GStrorage.localCache.put('isDisableBatteryOptLocal', hasDisabled == true); GStorage.localCache.put('isDisableBatteryOptLocal', hasDisabled == true);
} }
} }
bool isManufacturerBatteryOptimizationDisabled = GStrorage.localCache bool isManufacturerBatteryOptimizationDisabled = GStorage.localCache
.get('isManufacturerBatteryOptimizationDisabled', defaultValue: false); .get('isManufacturerBatteryOptimizationDisabled', defaultValue: false);
if (!isManufacturerBatteryOptimizationDisabled) { if (!isManufacturerBatteryOptimizationDisabled) {
final isManBatteryOptimizationDisabled = await DisableBatteryOptimization final isManBatteryOptimizationDisabled = await DisableBatteryOptimization
@ -33,7 +33,7 @@ void DisableBatteryOpt() async {
"按照步骤操作以禁用电池优化,以保证应用在后台正常运行", "按照步骤操作以禁用电池优化,以保证应用在后台正常运行",
); );
// 设置为已禁用 // 设置为已禁用
GStrorage.localCache.put( GStorage.localCache.put(
'isManufacturerBatteryOptimizationDisabled', hasDisabled == true); 'isManufacturerBatteryOptimizationDisabled', hasDisabled == true);
} }
} }

View File

@ -9,8 +9,8 @@ class Data {
} }
static Future historyStatus() async { static Future historyStatus() async {
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
if (userInfoCache.get('userInfoCache') == null) { if (userInfoCache.get('userInfoCache') == null) {
return; return;
} }

View File

@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'storage.dart'; import 'storage.dart';
Box<dynamic> setting = GStrorage.setting; Box<dynamic> setting = GStorage.setting;
void feedBack() { void feedBack() {
// 设置中是否开启 // 设置中是否开启
final bool enable = final bool enable =

View File

@ -5,10 +5,10 @@ import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
import 'package:pilipala/utils/storage.dart'; import 'package:pilipala/utils/storage.dart';
import '../models/common/index.dart'; import '../models/common/index.dart';
Box setting = GStrorage.setting; Box setting = GStorage.setting;
Box localCache = GStrorage.localCache; Box localCache = GStorage.localCache;
Box videoStorage = GStrorage.video; Box videoStorage = GStorage.video;
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
class GlobalDataCache { class GlobalDataCache {
late int imgQuality; late int imgQuality;

View File

@ -76,7 +76,7 @@ class LoginUtils {
if (result['status'] && result['data'].isLogin) { if (result['status'] && result['data'].isLogin) {
SmartDialog.showToast('登录成功'); SmartDialog.showToast('登录成功');
try { try {
Box userInfoCache = GStrorage.userInfo; Box userInfoCache = GStorage.userInfo;
if (!userInfoCache.isOpen) { if (!userInfoCache.isOpen) {
userInfoCache = await Hive.openBox('userInfo'); userInfoCache = await Hive.openBox('userInfo');
} }

View File

@ -13,7 +13,7 @@ class RecommendFilter {
} }
static void update() { static void update() {
var setting = GStrorage.setting; var setting = GStorage.setting;
// filterUnfollowedRatio = // filterUnfollowedRatio =
// setting.get(SettingBoxKey.filterUnfollowedRatio, defaultValue: 0); // setting.get(SettingBoxKey.filterUnfollowedRatio, defaultValue: 0);
minDurationForRcmd = minDurationForRcmd =

View File

@ -3,7 +3,7 @@ import 'package:hive_flutter/hive_flutter.dart';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:pilipala/models/user/info.dart'; import 'package:pilipala/models/user/info.dart';
class GStrorage { class GStorage {
static late final Box<dynamic> userInfo; static late final Box<dynamic> userInfo;
static late final Box<dynamic> localCache; static late final Box<dynamic> localCache;
static late final Box<dynamic> setting; static late final Box<dynamic> setting;

View File

@ -9,7 +9,7 @@ import '../http/index.dart';
import 'storage.dart'; import 'storage.dart';
class WbiSign { class WbiSign {
static Box<dynamic> localCache = GStrorage.localCache; static Box<dynamic> localCache = GStorage.localCache;
final List<int> mixinKeyEncTab = <int>[ final List<int> mixinKeyEncTab = <int>[
46, 46,
47, 47,