Merge branch 'fix'
This commit is contained in:
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
const CustomToast({super.key, required this.msg});
|
||||
|
@ -6,7 +6,7 @@ import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import '../../utils/storage.dart';
|
||||
import '../constants.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class NetworkImgLayer extends StatelessWidget {
|
||||
const NetworkImgLayer({
|
||||
|
@ -21,8 +21,8 @@ class Request {
|
||||
static late CookieManager cookieManager;
|
||||
static late final Dio dio;
|
||||
factory Request() => _instance;
|
||||
Box setting = GStrorage.setting;
|
||||
static Box localCache = GStrorage.localCache;
|
||||
Box setting = GStorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
late bool enableSystemProxy;
|
||||
late String systemProxyHost;
|
||||
late String systemProxyPort;
|
||||
@ -32,8 +32,8 @@ class Request {
|
||||
|
||||
/// 设置cookie
|
||||
static setCookie() async {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
final String cookiePath = await Utils.getCookiePath();
|
||||
final PersistCookieJar cookieJar = PersistCookieJar(
|
||||
ignoreExpires: true,
|
||||
|
@ -470,8 +470,8 @@ class MemberHttp {
|
||||
SmartDialog.dismiss();
|
||||
if (res.data['code'] == 0) {
|
||||
String accessKey = res.data['data']['access_token'];
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box localCache = GStorage.localCache;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
var userInfo = userInfoCache.get('userInfoCache');
|
||||
localCache.put(
|
||||
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});
|
||||
|
@ -11,7 +11,7 @@ import '../utils/storage.dart';
|
||||
import 'index.dart';
|
||||
|
||||
class SearchHttp {
|
||||
static Box setting = GStrorage.setting;
|
||||
static Box setting = GStorage.setting;
|
||||
static Future hotSearchList() async {
|
||||
var res = await Request().get(Api.hotSearchList);
|
||||
if (res.data is String) {
|
||||
|
@ -25,11 +25,11 @@ import 'init.dart';
|
||||
/// 返回{'status': bool, 'data': List}
|
||||
/// view层根据 status 判断渲染逻辑
|
||||
class VideoHttp {
|
||||
static Box localCache = GStrorage.localCache;
|
||||
static Box setting = GStrorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
static Box setting = GStorage.setting;
|
||||
static bool enableRcmdDynamic =
|
||||
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 {
|
||||
|
@ -32,7 +32,7 @@ void main() async {
|
||||
MediaKit.ensureInitialized();
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]);
|
||||
await GStrorage.init();
|
||||
await GStorage.init();
|
||||
clearLogs();
|
||||
Request();
|
||||
await Request.setCookie();
|
||||
@ -73,7 +73,7 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
// 主题色
|
||||
Color defaultColor =
|
||||
colorThemeTypes[setting.get(SettingBoxKey.customColor, defaultValue: 0)]
|
||||
|
@ -29,7 +29,7 @@ class ReplyMember {
|
||||
avatar = json['avatar'];
|
||||
level = json['level_info']['current_level'];
|
||||
pendant = Pendant.fromJson(json['pendant']);
|
||||
officialVerify = json['officia_verify'];
|
||||
officialVerify = json['official_verify'];
|
||||
vip = json['vip'];
|
||||
fansDetail = json['fans_detail'];
|
||||
userSailing = json['user_sailing'] != null
|
||||
|
@ -12,7 +12,7 @@ class BangumiController extends GetxController {
|
||||
RxInt total = 0.obs;
|
||||
int _currentPage = 1;
|
||||
bool isLoadingMore = true;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
late int mid;
|
||||
var userInfo;
|
||||
|
@ -48,7 +48,7 @@ class BangumiIntroController extends GetxController {
|
||||
RxBool hasCoin = false.obs;
|
||||
// 是否收藏
|
||||
RxBool hasFav = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
bool userLogin = false;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
List addMediaIdsNew = [];
|
||||
|
@ -116,7 +116,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
||||
String heroTag = Get.arguments['heroTag'];
|
||||
late final BangumiIntroController bangumiIntroController;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
late double sheetHeight;
|
||||
int? cid;
|
||||
bool isProcessing = false;
|
||||
|
@ -4,7 +4,7 @@ import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
late double sheetHeight;
|
||||
|
||||
class IntroDetail extends StatelessWidget {
|
||||
|
@ -36,7 +36,7 @@ class BangumiPanel extends StatefulWidget {
|
||||
class _BangumiPanelState extends State<BangumiPanel> {
|
||||
late RxInt currentIndex = (-1).obs;
|
||||
final ScrollController listViewScrollCtr = ScrollController();
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
dynamic userInfo;
|
||||
// 默认未开通
|
||||
int vipStatus = 0;
|
||||
|
@ -22,7 +22,7 @@ class _BlackListPageState extends State<BlackListPage> {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Future? _futureBuilderFuture;
|
||||
bool _isLoadingMore = false;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -32,7 +32,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
late PlDanmakuController _plDanmakuController;
|
||||
DanmakuController? _controller;
|
||||
// bool danmuPlayStatus = true;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late bool enableShowDanmaku;
|
||||
late List blockTypes;
|
||||
late double showArea;
|
||||
|
@ -50,11 +50,11 @@ class DynamicsController extends GetxController {
|
||||
];
|
||||
bool flag = false;
|
||||
RxInt initialValue = 0.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
var userInfo;
|
||||
RxBool isLoadingDynamic = false.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -24,7 +24,7 @@ class DynamicDetailController extends GetxController {
|
||||
ReplySortType _sortType = ReplySortType.time;
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
RxInt replyReqCode = 200.obs;
|
||||
bool isEnd = false;
|
||||
|
||||
@ -37,13 +37,13 @@ class DynamicDetailController extends GetxController {
|
||||
acount.value =
|
||||
int.parse(item!.modules!.moduleStat!.comment!.count ?? '0');
|
||||
}
|
||||
int deaultReplySortIndex =
|
||||
int defaultReplySortIndex =
|
||||
setting.get(SettingBoxKey.replySortType, defaultValue: 0);
|
||||
if (deaultReplySortIndex == 2) {
|
||||
if (defaultReplySortIndex == 2) {
|
||||
setting.put(SettingBoxKey.replySortType, 0);
|
||||
deaultReplySortIndex = 0;
|
||||
defaultReplySortIndex = 0;
|
||||
}
|
||||
_sortType = ReplySortType.values[deaultReplySortIndex];
|
||||
_sortType = ReplySortType.values[defaultReplySortIndex];
|
||||
sortTypeTitle.value = _sortType.titles;
|
||||
sortTypeLabel.value = _sortType.labels;
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
final MineController mineController = Get.put(MineController());
|
||||
late Future _futureBuilderFuture;
|
||||
late Future _futureBuilderFutureUp;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late ScrollController scrollController;
|
||||
|
||||
@override
|
||||
|
@ -6,7 +6,7 @@ import 'package:pilipala/models/fans/result.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class FansController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
|
@ -11,7 +11,7 @@ class FavController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
RxList<FavFolderItemData> favFolderList = <FavFolderItemData>[].obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
int currentPage = 1;
|
||||
int pageSize = 60;
|
||||
|
@ -11,7 +11,7 @@ import 'package:pilipala/utils/storage.dart';
|
||||
/// 查看自己的关注时,可以查看分类
|
||||
/// 查看其他人的关注时,只可以看全部
|
||||
class FollowController extends GetxController with GetTickerProviderStateMixin {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
|
@ -12,11 +12,11 @@ class HistoryController extends GetxController {
|
||||
RxList<HisListItem> historyList = <HisListItem>[].obs;
|
||||
RxBool isLoadingMore = false.obs;
|
||||
RxBool pauseStatus = false.obs;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
RxBool isLoading = false.obs;
|
||||
RxBool enableMultiple = false.obs;
|
||||
RxInt checkedCount = 0.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
|
||||
@override
|
||||
|
@ -14,12 +14,12 @@ class HomeController extends GetxController with GetTickerProviderStateMixin {
|
||||
late TabController tabController;
|
||||
late List tabsCtrList;
|
||||
late List<Widget> tabsPageList;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box settingStorage = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box settingStorage = GStorage.setting;
|
||||
RxBool userLogin = false.obs;
|
||||
RxString userFace = ''.obs;
|
||||
var userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late final StreamController<bool> searchBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
late bool hideSearchBar;
|
||||
|
@ -5,7 +5,7 @@ import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
class HomeAppBar extends StatelessWidget {
|
||||
const HomeAppBar({super.key});
|
||||
|
@ -25,7 +25,7 @@ class HtmlRenderController extends GetxController {
|
||||
ReplySortType _sortType = ReplySortType.time;
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -13,7 +13,7 @@ class LaterController extends GetxController {
|
||||
RxList<HotVideoItemModel> laterList = <HotVideoItemModel>[].obs;
|
||||
int count = 0;
|
||||
RxBool isLoading = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
|
||||
@override
|
||||
|
@ -17,7 +17,7 @@ class LiveController extends GetxController {
|
||||
RxInt liveFollowingCount = 0.obs;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
@ -7,7 +7,7 @@ import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class LiveFollowController extends GetxController {
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
int _currentPage = 1;
|
||||
RxInt liveFollowingCount = 0.obs;
|
||||
RxList<LiveFollowingItemModel> liveFollowingList =
|
||||
|
@ -33,7 +33,7 @@ class LiveRoomController extends GetxController {
|
||||
int? tempCurrentQn;
|
||||
late List<Map<String, dynamic>> acceptQnList;
|
||||
RxString currentQnDesc = ''.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int userId = 0;
|
||||
PlSocket? plSocket;
|
||||
List<String> danmuHostList = [];
|
||||
|
@ -35,7 +35,7 @@ class _BottomControlState extends State<BottomControl> {
|
||||
TextStyle subTitleStyle = const TextStyle(fontSize: 12);
|
||||
TextStyle titleStyle = const TextStyle(fontSize: 14);
|
||||
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -20,12 +20,12 @@ class MainController extends GetxController {
|
||||
late List<int> navBarSort;
|
||||
final StreamController<bool> bottomBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
DateTime? _lastPressedAt;
|
||||
late bool hideTabBar;
|
||||
late PageController pageController;
|
||||
int selectedIndex = 0;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
dynamic userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
late Rx<DynamicBadgeMode> dynamicBadgeType = DynamicBadgeMode.number.obs;
|
||||
|
@ -30,7 +30,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
late MineController _mineController;
|
||||
|
||||
int? _lastSelectTime; //上次点击时间
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late bool enableMYBar;
|
||||
|
||||
@override
|
||||
@ -113,14 +113,14 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
await GStrorage.close();
|
||||
await GStorage.close();
|
||||
EventBus().off(EventName.loginEvent);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
double statusBarHeight = MediaQuery.of(context).padding.top;
|
||||
double sheetHeight = MediaQuery.sizeOf(context).height -
|
||||
MediaQuery.of(context).padding.top -
|
||||
|
@ -18,7 +18,7 @@ class MemberController extends GetxController {
|
||||
late Map userStat;
|
||||
RxString face = ''.obs;
|
||||
String? heroTag;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late int ownerMid;
|
||||
// 投稿列表
|
||||
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
||||
|
@ -17,8 +17,8 @@ class MineController extends GetxController {
|
||||
Rx<UserInfoData> userInfo = UserInfoData().obs;
|
||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
List menuList = [
|
||||
{
|
||||
'icon': Icons.history,
|
||||
|
@ -6,7 +6,7 @@ import 'package:pilipala/http/user.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
class MineEditController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final TextEditingController unameCtr = TextEditingController();
|
||||
final TextEditingController useridCtr = TextEditingController();
|
||||
|
@ -14,7 +14,7 @@ class RankController extends GetxController with GetTickerProviderStateMixin {
|
||||
late TabController tabController;
|
||||
late List tabsCtrList;
|
||||
late List<Widget> tabsPageList;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late final StreamController<bool> searchBarStream =
|
||||
StreamController<bool>.broadcast();
|
||||
|
||||
|
@ -14,7 +14,7 @@ class RcmdController extends GetxController {
|
||||
// RxList<RecVideoItemModel> webVideoList = <RecVideoItemModel>[].obs;
|
||||
bool isLoadingMore = true;
|
||||
OverlayEntry? popupDialog;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
RxInt crossAxisCount = 2.obs;
|
||||
late bool enableSaveLastData;
|
||||
late String defaultRcmdType = 'web';
|
||||
|
@ -15,7 +15,7 @@ class SSearchController extends GetxController {
|
||||
RxString searchKeyWord = ''.obs;
|
||||
Rx<TextEditingController> controller = TextEditingController().obs;
|
||||
RxList<HotSearchItem> hotSearchList = <HotSearchItem>[].obs;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
List historyCacheList = [];
|
||||
RxList historyList = [].obs;
|
||||
RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs;
|
||||
@ -23,7 +23,7 @@ class SSearchController extends GetxController {
|
||||
Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间
|
||||
String hintText = '搜索';
|
||||
RxString defaultSearch = ''.obs;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
bool enableHotKey = true;
|
||||
bool enableSearchSuggest = true;
|
||||
|
||||
|
@ -13,9 +13,9 @@ import '../main/index.dart';
|
||||
import 'widgets/select_dialog.dart';
|
||||
|
||||
class SettingController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
Box localCache = GStorage.localCache;
|
||||
|
||||
RxBool userLogin = false.obs;
|
||||
RxBool feedBackEnable = false.obs;
|
||||
|
@ -19,8 +19,8 @@ class ExtraSetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ExtraSettingState extends State<ExtraSetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
static Box localCache = GStrorage.localCache;
|
||||
Box setting = GStorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
late dynamic defaultReplySort;
|
||||
late dynamic defaultDynamicType;
|
||||
late dynamic enableSystemProxy;
|
||||
|
@ -13,7 +13,7 @@ class ActionMenuSetPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ActionMenuSetPageState extends State<ActionMenuSetPage> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late List<String> actionTypeSort;
|
||||
late List<Map> allLabels;
|
||||
|
||||
|
@ -142,7 +142,7 @@ class _ColorSelectPageState extends State<ColorSelectPage> {
|
||||
}
|
||||
|
||||
class ColorSelectController extends GetxController {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
RxBool dynamicColor = true.obs;
|
||||
RxInt type = 0.obs;
|
||||
late final List<Map<String, dynamic>> colorThemes;
|
||||
|
@ -16,7 +16,7 @@ class _SetDiaplayModeState extends State<SetDiaplayMode> {
|
||||
List<DisplayMode> modes = <DisplayMode>[];
|
||||
DisplayMode? active;
|
||||
DisplayMode? preferred;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
final ValueNotifier<int> page = ValueNotifier<int>(0);
|
||||
late final PageController controller = PageController()
|
||||
|
@ -11,7 +11,7 @@ class FontSizeSelectPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
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];
|
||||
late double minsize;
|
||||
late double maxSize;
|
||||
|
@ -12,7 +12,7 @@ class TabbarSetPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TabbarSetPageState extends State<TabbarSetPage> {
|
||||
Box settingStorage = GStrorage.setting;
|
||||
Box settingStorage = GStorage.setting;
|
||||
late List defaultTabs;
|
||||
late List<String> tabbarSort;
|
||||
|
||||
|
@ -13,7 +13,7 @@ class NavigationBarSetPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _NavigationbarSetPageState extends State<NavigationBarSetPage> {
|
||||
Box settingStorage = GStrorage.setting;
|
||||
Box settingStorage = GStorage.setting;
|
||||
late List defaultNavTabs;
|
||||
late List<int> navBarSort;
|
||||
|
||||
|
@ -16,7 +16,7 @@ class PlayGesturePage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PlayGesturePageState extends State<PlayGesturePage> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late int fullScreenGestureMode;
|
||||
|
||||
@override
|
||||
|
@ -14,8 +14,8 @@ class PlaySpeedPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PlaySpeedPageState extends State<PlaySpeedPage> {
|
||||
Box videoStorage = GStrorage.video;
|
||||
Box settingStorage = GStrorage.setting;
|
||||
Box videoStorage = GStorage.video;
|
||||
Box settingStorage = GStorage.setting;
|
||||
late double playSpeedDefault;
|
||||
late List<double> playSpeedSystem;
|
||||
late double longPressSpeedDefault;
|
||||
|
@ -23,7 +23,7 @@ class PlaySetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PlaySettingState extends State<PlaySetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late dynamic defaultVideoQa;
|
||||
late dynamic defaultLiveQa;
|
||||
late dynamic defaultAudioQa;
|
||||
|
@ -14,7 +14,7 @@ class PrivacySetting extends StatefulWidget {
|
||||
|
||||
class _PrivacySettingState extends State<PrivacySetting> {
|
||||
bool userLogin = false;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
var userInfo;
|
||||
|
||||
@override
|
||||
|
@ -17,10 +17,10 @@ class RecommendSetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _RecommendSettingState extends State<RecommendSetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
static Box localCache = GStrorage.localCache;
|
||||
Box setting = GStorage.setting;
|
||||
static Box localCache = GStorage.localCache;
|
||||
late dynamic defaultRcmdType;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late dynamic userInfo;
|
||||
bool userLogin = false;
|
||||
late dynamic accessKeyInfo;
|
||||
@ -247,10 +247,9 @@ class _RecommendSettingState extends State<RecommendSetting> {
|
||||
'* 其它(如热门视频、手动搜索、链接跳转等)均不受过滤器影响。\n'
|
||||
'* 设定较严苛的条件可导致推荐项数锐减或多次请求,请酌情选择。\n'
|
||||
'* 后续可能会增加更多过滤条件,敬请期待。',
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.labelSmall!
|
||||
.copyWith(color: Theme.of(context).colorScheme.outline.withOpacity(0.7)),
|
||||
style: Theme.of(context).textTheme.labelSmall!.copyWith(
|
||||
color:
|
||||
Theme.of(context).colorScheme.outline.withOpacity(0.7)),
|
||||
),
|
||||
)
|
||||
],
|
||||
|
@ -28,7 +28,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
final ColorSelectController colorSelectController =
|
||||
Get.put(ColorSelectController());
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late int picQuality;
|
||||
late ThemeType _tempThemeValue;
|
||||
late dynamic defaultCustomRows;
|
||||
|
@ -19,7 +19,7 @@ class SetSelectItem extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SetSelectItemState extends State<SetSelectItem> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late dynamic currentVal;
|
||||
late int currentIndex;
|
||||
late List menus;
|
||||
|
@ -28,7 +28,7 @@ class SetSwitchItem extends StatefulWidget {
|
||||
|
||||
class _SetSwitchItemState extends State<SetSwitchItem> {
|
||||
// ignore: non_constant_identifier_names
|
||||
Box Setting = GStrorage.setting;
|
||||
Box Setting = GStorage.setting;
|
||||
late bool val;
|
||||
|
||||
@override
|
||||
|
@ -11,7 +11,7 @@ import '../../models/user/sub_folder.dart';
|
||||
class SubController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Rx<SubFolderModelData> subFolderData = SubFolderModelData().obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
int currentPage = 1;
|
||||
int pageSize = 20;
|
||||
|
@ -71,9 +71,9 @@ class VideoDetailController extends GetxController
|
||||
RxBool enableHA = false.obs;
|
||||
|
||||
/// 本地存储
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box setting = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box localCache = GStorage.localCache;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
RxInt oid = 0.obs;
|
||||
// 评论id 请求楼中楼评论使用
|
||||
|
@ -41,7 +41,7 @@ class VideoIntroController extends GetxController {
|
||||
RxBool hasFav = false.obs;
|
||||
// 是否不喜欢
|
||||
RxBool hasDisLike = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
bool userLogin = false;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
List addMediaIdsNew = [];
|
||||
|
@ -137,8 +137,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
late String heroTag;
|
||||
late final VideoIntroController videoIntroController;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> setting = GStrorage.setting;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
final Box<dynamic> setting = GStorage.setting;
|
||||
late double sheetHeight;
|
||||
late final dynamic owner;
|
||||
late int mid;
|
||||
|
@ -16,7 +16,7 @@ class FavPanel extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FavPanelState extends State<FavPanel> {
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
late Future _futureBuilderFuture;
|
||||
|
||||
@override
|
||||
|
@ -18,7 +18,7 @@ class GroupPanel extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _GroupPanelState extends State<GroupPanel> {
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
late Future _futureBuilderFuture;
|
||||
late List<MemberTagItemModel> tagsList;
|
||||
bool showDefault = true;
|
||||
|
@ -32,20 +32,20 @@ class VideoReplyController extends GetxController {
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
RxInt replyReqCode = 200.obs;
|
||||
bool isEnd = false;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
int deaultReplySortIndex =
|
||||
int defaultReplySortIndex =
|
||||
setting.get(SettingBoxKey.replySortType, defaultValue: 0) as int;
|
||||
if (deaultReplySortIndex == 2) {
|
||||
if (defaultReplySortIndex == 2) {
|
||||
setting.put(SettingBoxKey.replySortType, 0);
|
||||
deaultReplySortIndex = 0;
|
||||
defaultReplySortIndex = 0;
|
||||
}
|
||||
_sortType = ReplySortType.values[deaultReplySortIndex];
|
||||
_sortType = ReplySortType.values[defaultReplySortIndex];
|
||||
sortTypeTitle.value = _sortType.titles;
|
||||
sortTypeLabel.value = _sortType.labels;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ import 'package:pilipala/utils/utils.dart';
|
||||
import 'reply_save.dart';
|
||||
import 'zan.dart';
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
class ReplyItem extends StatelessWidget {
|
||||
const ReplyItem({
|
||||
|
@ -42,7 +42,7 @@ class VideoReplyReplyPanel extends StatefulWidget {
|
||||
class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
|
||||
late VideoReplyReplyController _videoReplyReplyController;
|
||||
late AnimationController replyAnimationCtl;
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
Future? _futureBuilderFuture;
|
||||
late ScrollController scrollController;
|
||||
|
||||
|
@ -54,8 +54,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
Rx<PlayerStatus> playerStatus = PlayerStatus.playing.obs;
|
||||
double doubleOffset = 0;
|
||||
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> setting = GStrorage.setting;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
final Box<dynamic> setting = GStorage.setting;
|
||||
late double statusBarHeight;
|
||||
final double videoHeight = Get.size.width * 9 / 16;
|
||||
late Future _futureBuilderFuture;
|
||||
|
@ -52,8 +52,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
static const TextStyle subTitleStyle = TextStyle(fontSize: 12);
|
||||
static const TextStyle titleStyle = TextStyle(fontSize: 14);
|
||||
Size get preferredSize => const Size(double.infinity, kToolbarHeight);
|
||||
final Box<dynamic> localCache = GStrorage.localCache;
|
||||
final Box<dynamic> videoStorage = GStrorage.video;
|
||||
final Box<dynamic> localCache = GStorage.localCache;
|
||||
final Box<dynamic> videoStorage = GStorage.video;
|
||||
late List<double> speedsList;
|
||||
double buttonSpace = 8;
|
||||
RxBool isFullScreen = false.obs;
|
||||
|
@ -20,7 +20,7 @@ class WhisperDetailController extends GetxController {
|
||||
//表情转换图片规则
|
||||
RxList<dynamic> eInfos = [].obs;
|
||||
final TextEditingController replyContentController = TextEditingController();
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
List emoteList = [];
|
||||
List<String> picList = [];
|
||||
|
||||
|
@ -30,7 +30,7 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
||||
late double emoteHeight = 230.0;
|
||||
double keyboardHeight = 0.0; // 键盘高度
|
||||
RxString toolbarType = ''.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -56,8 +56,7 @@ class ChatItem extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isOwner =
|
||||
item.senderUid == GStrorage.userInfo.get('userInfoCache').mid;
|
||||
bool isOwner = item.senderUid == GStorage.userInfo.get('userInfoCache').mid;
|
||||
|
||||
bool isPic = item.msgType == MsgType.pic.value; // 图片
|
||||
bool isText = item.msgType == MsgType.text.value; // 文本
|
||||
|
@ -27,9 +27,9 @@ import '../../models/video/subTitile/content.dart';
|
||||
import '../../models/video/subTitile/result.dart';
|
||||
// import 'package:wakelock_plus/wakelock_plus.dart';
|
||||
|
||||
Box videoStorage = GStrorage.video;
|
||||
Box setting = GStrorage.setting;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box videoStorage = GStorage.video;
|
||||
Box setting = GStorage.setting;
|
||||
Box localCache = GStorage.localCache;
|
||||
|
||||
class PlPlayerController {
|
||||
Player? _videoPlayerController;
|
||||
|
@ -82,7 +82,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final RxDouble _distance = 0.0.obs;
|
||||
final RxBool _volumeInterceptEventStream = false.obs;
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late FullScreenMode mode;
|
||||
late int defaultBtmProgressBehavior;
|
||||
late bool enableQuickDouble;
|
||||
|
@ -66,7 +66,7 @@ import '../pages/whisper/index.dart';
|
||||
import '../pages/whisper_detail/index.dart';
|
||||
import '../utils/storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class Routes {
|
||||
static final List<GetPage<dynamic>> getPages = [
|
||||
|
@ -24,7 +24,7 @@ Future<VideoPlayerServiceHandler> initAudioService() async {
|
||||
|
||||
class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
||||
static final List<MediaItem> _item = [];
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
bool enableBackgroundPlay = false;
|
||||
PlPlayerController player = PlPlayerController();
|
||||
|
||||
|
@ -9,7 +9,7 @@ void DisableBatteryOpt() async {
|
||||
}
|
||||
// 本地缓存中读取 是否禁用了电池优化 默认未禁用
|
||||
bool isDisableBatteryOptLocal =
|
||||
GStrorage.localCache.get('isDisableBatteryOptLocal', defaultValue: false);
|
||||
GStorage.localCache.get('isDisableBatteryOptLocal', defaultValue: false);
|
||||
if (!isDisableBatteryOptLocal) {
|
||||
final isBatteryOptimizationDisabled =
|
||||
await DisableBatteryOptimization.isBatteryOptimizationDisabled;
|
||||
@ -17,11 +17,11 @@ void DisableBatteryOpt() async {
|
||||
final hasDisabled = await DisableBatteryOptimization
|
||||
.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);
|
||||
if (!isManufacturerBatteryOptimizationDisabled) {
|
||||
final isManBatteryOptimizationDisabled = await DisableBatteryOptimization
|
||||
@ -33,7 +33,7 @@ void DisableBatteryOpt() async {
|
||||
"按照步骤操作以禁用电池优化,以保证应用在后台正常运行",
|
||||
);
|
||||
// 设置为已禁用
|
||||
GStrorage.localCache.put(
|
||||
GStorage.localCache.put(
|
||||
'isManufacturerBatteryOptimizationDisabled', hasDisabled == true);
|
||||
}
|
||||
}
|
||||
|
@ -9,8 +9,8 @@ class Data {
|
||||
}
|
||||
|
||||
static Future historyStatus() async {
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box localCache = GStorage.localCache;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
if (userInfoCache.get('userInfoCache') == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
void feedBack() {
|
||||
// 设置中是否开启
|
||||
final bool enable =
|
||||
|
@ -5,10 +5,10 @@ import 'package:pilipala/plugin/pl_player/models/play_speed.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
import '../models/common/index.dart';
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box videoStorage = GStrorage.video;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
Box localCache = GStorage.localCache;
|
||||
Box videoStorage = GStorage.video;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
class GlobalDataCache {
|
||||
late int imgQuality;
|
||||
|
@ -76,7 +76,7 @@ class LoginUtils {
|
||||
if (result['status'] && result['data'].isLogin) {
|
||||
SmartDialog.showToast('登录成功');
|
||||
try {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
if (!userInfoCache.isOpen) {
|
||||
userInfoCache = await Hive.openBox('userInfo');
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ class RecommendFilter {
|
||||
}
|
||||
|
||||
static void update() {
|
||||
var setting = GStrorage.setting;
|
||||
var setting = GStorage.setting;
|
||||
// filterUnfollowedRatio =
|
||||
// setting.get(SettingBoxKey.filterUnfollowedRatio, defaultValue: 0);
|
||||
minDurationForRcmd =
|
||||
|
@ -3,7 +3,7 @@ import 'package:hive_flutter/hive_flutter.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:pilipala/models/user/info.dart';
|
||||
|
||||
class GStrorage {
|
||||
class GStorage {
|
||||
static late final Box<dynamic> userInfo;
|
||||
static late final Box<dynamic> localCache;
|
||||
static late final Box<dynamic> setting;
|
||||
|
@ -9,7 +9,7 @@ import '../http/index.dart';
|
||||
import 'storage.dart';
|
||||
|
||||
class WbiSign {
|
||||
static Box<dynamic> localCache = GStrorage.localCache;
|
||||
static Box<dynamic> localCache = GStorage.localCache;
|
||||
final List<int> mixinKeyEncTab = <int>[
|
||||
46,
|
||||
47,
|
||||
|
Reference in New Issue
Block a user