mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
Fix typo
This commit is contained in:
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
const CustomToast({super.key, required this.msg});
|
||||
|
||||
@@ -45,7 +45,7 @@ class ListSheet {
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
if (episode.badge != null && episode.badge == "会员") {
|
||||
dynamic userInfo = GStrorage.userInfo.get('userInfoCache');
|
||||
dynamic userInfo = GStorage.userInfo.get('userInfoCache');
|
||||
int vipStatus = 0;
|
||||
if (userInfo != null) {
|
||||
vipStatus = userInfo.vipStatus;
|
||||
|
||||
@@ -7,7 +7,7 @@ import 'package:PiliPalaX/utils/global_data.dart';
|
||||
import '../../utils/storage.dart';
|
||||
import '../constants.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class NetworkImgLayer extends StatelessWidget {
|
||||
const NetworkImgLayer({
|
||||
|
||||
@@ -74,7 +74,7 @@ class VideoPopupMenu extends StatelessWidget {
|
||||
// 不感兴趣
|
||||
PopupMenuItem<String>(
|
||||
onTap: () async {
|
||||
String? accessKey = GStrorage.localCache
|
||||
String? accessKey = GStorage.localCache
|
||||
.get(LocalCacheKey.accessKey, defaultValue: {})['value'];
|
||||
if (accessKey == null || accessKey == "") {
|
||||
SmartDialog.showToast("本操作使用app端接口,请前往【隐私设置】刷新access_key");
|
||||
@@ -262,13 +262,13 @@ class VideoPopupMenu extends StatelessWidget {
|
||||
act: 5,
|
||||
reSrc: 11,
|
||||
);
|
||||
List<int> blackMidsList = GStrorage.setting
|
||||
List<int> blackMidsList = GStorage.setting
|
||||
.get(SettingBoxKey.blackMidsList,
|
||||
defaultValue: [-1])
|
||||
.map<int>((i) => i as int)
|
||||
.toList();
|
||||
blackMidsList.insert(0, videoItem.owner.mid);
|
||||
GStrorage.setting
|
||||
GStorage.setting
|
||||
.put(SettingBoxKey.blackMidsList, blackMidsList);
|
||||
Get.back();
|
||||
SmartDialog.showToast(res['msg'] ?? '成功');
|
||||
|
||||
@@ -23,8 +23,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,7 +32,7 @@ class Request {
|
||||
|
||||
/// 设置cookie
|
||||
static setCookie() async {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
final String cookiePath = await Utils.getCookiePath();
|
||||
final PersistCookieJar cookieJar = PersistCookieJar(
|
||||
ignoreExpires: true,
|
||||
|
||||
@@ -27,7 +27,7 @@ class ApiInterceptor extends Interceptor {
|
||||
final String? accessKey = uri.queryParameters['access_key'];
|
||||
final String? mid = uri.queryParameters['mid'];
|
||||
try {
|
||||
Box localCache = GStrorage.localCache;
|
||||
Box localCache = GStorage.localCache;
|
||||
localCache.put(LocalCacheKey.accessKey,
|
||||
<String, String?>{'mid': mid, 'value': accessKey});
|
||||
} catch (_) {}
|
||||
|
||||
@@ -475,8 +475,8 @@ class MemberHttp {
|
||||
.post(Api.qrcodePoll, queryParameters: {...params, 'sign': sign});
|
||||
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});
|
||||
|
||||
@@ -9,7 +9,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) {
|
||||
|
||||
@@ -23,11 +23,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 {
|
||||
@@ -322,7 +322,7 @@ class VideoHttp {
|
||||
|
||||
// (取消)点踩
|
||||
static Future dislikeVideo({required String bvid, required bool type}) async {
|
||||
String? accessKey = GStrorage.localCache
|
||||
String? accessKey = GStorage.localCache
|
||||
.get(LocalCacheKey.accessKey, defaultValue: {})['value'];
|
||||
if (accessKey == null || accessKey == "") {
|
||||
return {'status': false, 'msg': "本操作使用app端接口,请前往【隐私设置】刷新access_key"};
|
||||
@@ -352,7 +352,7 @@ class VideoHttp {
|
||||
required int id,
|
||||
int? reasonId,
|
||||
int? feedbackId}) async {
|
||||
String? accessKey = GStrorage.localCache
|
||||
String? accessKey = GStorage.localCache
|
||||
.get(LocalCacheKey.accessKey, defaultValue: {})['value'];
|
||||
if (accessKey == null || accessKey == "") {
|
||||
return {'status': false, 'msg': "本操作使用app端接口,请前往【隐私设置】刷新access_key"};
|
||||
@@ -383,7 +383,7 @@ class VideoHttp {
|
||||
required int id,
|
||||
int? reasonId,
|
||||
int? feedbackId}) async {
|
||||
String? accessKey = GStrorage.localCache
|
||||
String? accessKey = GStorage.localCache
|
||||
.get(LocalCacheKey.accessKey, defaultValue: {})['value'];
|
||||
if (accessKey == null || accessKey == "") {
|
||||
return {'status': false, 'msg': "本操作使用app端接口,请前往【隐私设置】刷新access_key"};
|
||||
|
||||
@@ -29,12 +29,12 @@ import './services/loggeer.dart';
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
await GStrorage.init();
|
||||
if (GStrorage.setting
|
||||
await GStorage.init();
|
||||
if (GStorage.setting
|
||||
.get(SettingBoxKey.autoClearCache, defaultValue: false)) {
|
||||
await CacheManage.clearLibraryCache();
|
||||
}
|
||||
if (GStrorage.setting
|
||||
if (GStorage.setting
|
||||
.get(SettingBoxKey.horizontalScreen, defaultValue: false)) {
|
||||
await SystemChrome.setPreferredOrientations(
|
||||
//支持竖屏与横屏
|
||||
@@ -92,7 +92,7 @@ void main() async {
|
||||
statusBarColor: Colors.transparent,
|
||||
));
|
||||
Data.init();
|
||||
PiliSchame.init();
|
||||
PiliScheme.init();
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@@ -100,7 +100,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)]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
enum VideoQuality {
|
||||
speed240,
|
||||
flunt360,
|
||||
fluent360,
|
||||
clear480,
|
||||
high720,
|
||||
high72060,
|
||||
|
||||
@@ -196,7 +196,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
title: const Text('导出设置至剪贴板'),
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
String data = await GStrorage.exportAllSettings();
|
||||
String data = await GStorage.exportAllSettings();
|
||||
Clipboard.setData(ClipboardData(text: data));
|
||||
SmartDialog.showToast('已复制到剪贴板');
|
||||
},
|
||||
@@ -231,7 +231,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
try {
|
||||
await GStrorage.importAllSettings(
|
||||
await GStorage.importAllSettings(
|
||||
data.text!);
|
||||
SmartDialog.showToast('导入成功');
|
||||
} catch (e) {
|
||||
@@ -271,9 +271,9 @@ class _AboutPageState extends State<AboutPage> {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
GStrorage.setting.clear();
|
||||
GStrorage.localCache.clear();
|
||||
GStrorage.video.clear();
|
||||
GStorage.setting.clear();
|
||||
GStorage.localCache.clear();
|
||||
GStorage.video.clear();
|
||||
SmartDialog.showToast('重置成功');
|
||||
},
|
||||
child: const Text('确定'),
|
||||
@@ -291,7 +291,7 @@ class _AboutPageState extends State<AboutPage> {
|
||||
}
|
||||
|
||||
class AboutController extends GetxController {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
final SettingController settingController = Get.put(SettingController());
|
||||
RxString currentVersion = ''.obs;
|
||||
RxString remoteVersion = ''.obs;
|
||||
|
||||
@@ -11,7 +11,7 @@ class BangumiController extends GetxController {
|
||||
RxList<BangumiListItemModel> bangumiFollowList = <BangumiListItemModel>[].obs;
|
||||
int _currentPage = 1;
|
||||
bool isLoadingMore = true;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
late int mid;
|
||||
var userInfo;
|
||||
|
||||
@@ -51,7 +51,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 = [];
|
||||
|
||||
@@ -12,7 +12,7 @@ import 'package:PiliPalaX/pages/main/index.dart';
|
||||
|
||||
import '../../utils/grid.dart';
|
||||
import 'controller.dart';
|
||||
import 'widgets/bangumu_card_v.dart';
|
||||
import 'widgets/bangumi_card_v.dart';
|
||||
|
||||
class BangumiPage extends StatefulWidget {
|
||||
const BangumiPage({super.key});
|
||||
@@ -23,7 +23,7 @@ class BangumiPage extends StatefulWidget {
|
||||
|
||||
class _BangumiPageState extends State<BangumiPage>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
final BangumiController _bangumidController = Get.put(BangumiController());
|
||||
final BangumiController _bangumiController = Get.put(BangumiController());
|
||||
late Future? _futureBuilderFuture;
|
||||
late Future? _futureBuilderFutureFollow;
|
||||
late ScrollController scrollController;
|
||||
@@ -34,20 +34,20 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
scrollController = _bangumidController.scrollController;
|
||||
scrollController = _bangumiController.scrollController;
|
||||
StreamController<bool> mainStream =
|
||||
Get.find<MainController>().bottomBarStream;
|
||||
StreamController<bool> searchBarStream =
|
||||
Get.find<HomeController>().searchBarStream;
|
||||
_futureBuilderFuture = _bangumidController.queryBangumiListFeed();
|
||||
_futureBuilderFutureFollow = _bangumidController.queryBangumiFollow();
|
||||
_futureBuilderFuture = _bangumiController.queryBangumiListFeed();
|
||||
_futureBuilderFutureFollow = _bangumiController.queryBangumiFollow();
|
||||
scrollController.addListener(
|
||||
() async {
|
||||
if (scrollController.position.pixels >=
|
||||
scrollController.position.maxScrollExtent - 200) {
|
||||
EasyThrottle.throttle('my-throttler', const Duration(seconds: 1), () {
|
||||
_bangumidController.isLoadingMore = true;
|
||||
_bangumidController.onLoad();
|
||||
_bangumiController.isLoadingMore = true;
|
||||
_bangumiController.onLoad();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -75,17 +75,17 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
super.build(context);
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
await _bangumidController.queryBangumiListFeed();
|
||||
return _bangumidController.queryBangumiFollow();
|
||||
await _bangumiController.queryBangumiListFeed();
|
||||
return _bangumiController.queryBangumiFollow();
|
||||
},
|
||||
child: CustomScrollView(
|
||||
controller: _bangumidController.scrollController,
|
||||
controller: _bangumiController.scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
slivers: [
|
||||
SliverToBoxAdapter(
|
||||
child: Obx(
|
||||
() => Visibility(
|
||||
visible: _bangumidController.userLogin.value,
|
||||
visible: _bangumiController.userLogin.value,
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
@@ -103,7 +103,7 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
_futureBuilderFutureFollow =
|
||||
_bangumidController.queryBangumiFollow();
|
||||
_bangumiController.queryBangumiFollow();
|
||||
});
|
||||
},
|
||||
icon: const Icon(
|
||||
@@ -126,7 +126,7 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
return const SizedBox();
|
||||
}
|
||||
Map data = snapshot.data as Map;
|
||||
List list = _bangumidController.bangumiFollowList;
|
||||
List list = _bangumiController.bangumiFollowList;
|
||||
if (data['status']) {
|
||||
return Obx(
|
||||
() => list.isNotEmpty
|
||||
@@ -140,14 +140,14 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
margin: EdgeInsets.only(
|
||||
left: StyleString.safeSpace,
|
||||
right: index ==
|
||||
_bangumidController
|
||||
_bangumiController
|
||||
.bangumiFollowList
|
||||
.length -
|
||||
1
|
||||
? StyleString.safeSpace
|
||||
: 0),
|
||||
child: BangumiCardV(
|
||||
bangumiItem: _bangumidController
|
||||
bangumiItem: _bangumiController
|
||||
.bangumiFollowList[index],
|
||||
),
|
||||
);
|
||||
@@ -197,18 +197,18 @@ class _BangumiPageState extends State<BangumiPage>
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['status']) {
|
||||
return Obx(() => contentGrid(
|
||||
_bangumidController, _bangumidController.bangumiList));
|
||||
_bangumiController, _bangumiController.bangumiList));
|
||||
} else {
|
||||
return HttpError(
|
||||
errMsg: data['msg'],
|
||||
fn: () {
|
||||
_futureBuilderFuture =
|
||||
_bangumidController.queryBangumiListFeed();
|
||||
_bangumiController.queryBangumiListFeed();
|
||||
},
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return contentGrid(_bangumidController, []);
|
||||
return contentGrid(_bangumiController, []);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
@@ -28,7 +28,7 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
||||
late int currentIndex;
|
||||
final ScrollController listViewScrollCtr = ScrollController();
|
||||
final ScrollController listViewScrollCtr_2 = 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() {
|
||||
|
||||
@@ -28,7 +28,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;
|
||||
|
||||
@@ -19,7 +19,7 @@ class _DanmakuBlockPageState extends State<DanmakuBlockPage> {
|
||||
final DanmakuBlockController _danmakuBlockController =
|
||||
Get.put(DanmakuBlockController());
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late PlPlayerController plPlayerController;
|
||||
|
||||
static const Map<int, String> ruleLabels = {
|
||||
|
||||
@@ -30,11 +30,11 @@ class DynamicsController extends GetxController
|
||||
late List<Widget> tabsPageList;
|
||||
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;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -13,7 +13,7 @@ class DynamicsTabController extends GetxController {
|
||||
RxList<DynamicItemModel> dynamicsList = <DynamicItemModel>[].obs;
|
||||
RxBool isLoadingMore = false.obs;
|
||||
String dynamicsType = 'all';
|
||||
// Box userInfoCache = GStrorage.userInfo;
|
||||
// Box userInfoCache = GStorage.userInfo;
|
||||
// bool userLogin = false;
|
||||
int mid = -1;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
_futureBuilderFuture = _dynamicsTabController.queryFollowDynamic(
|
||||
'init', widget.dynamicsType, mid);
|
||||
});
|
||||
dynamicsWaterfallFlow = GStrorage.setting
|
||||
dynamicsWaterfallFlow = GStorage.setting
|
||||
.get(SettingBoxKey.dynamicsWaterfallFlow, defaultValue: true);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class _DynamicsTabPageState extends State<DynamicsTabPage>
|
||||
// key:
|
||||
// ValueKey<String>(widget.dynamicsType + widget.mid.value.toString()),
|
||||
onRefresh: () async {
|
||||
dynamicsWaterfallFlow = GStrorage.setting
|
||||
dynamicsWaterfallFlow = GStorage.setting
|
||||
.get(SettingBoxKey.dynamicsWaterfallFlow, defaultValue: true);
|
||||
await Future.wait(<Future>[
|
||||
_dynamicsTabController.onRefresh(),
|
||||
|
||||
@@ -24,7 +24,7 @@ class _DynamicsPageState extends State<DynamicsPage>
|
||||
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
|
||||
final DynamicsController _dynamicsController = Get.put(DynamicsController());
|
||||
late Future _futureBuilderFutureUp;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late ScrollController scrollController;
|
||||
late UpPanelPosition upPanelPosition;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class _ContentState extends State<Content> {
|
||||
}
|
||||
|
||||
InlineSpan picsNodes() {
|
||||
List<InlineSpan> spanChilds = [];
|
||||
List<InlineSpan> spanChildren = [];
|
||||
int len = pics.length;
|
||||
List<String> picList = [];
|
||||
|
||||
@@ -47,8 +47,8 @@ class _ContentState extends State<Content> {
|
||||
picList.add(pictureItem.url!);
|
||||
|
||||
/// 图片上方的空白间隔
|
||||
// spanChilds.add(const TextSpan(text: '\n'));
|
||||
spanChilds.add(
|
||||
// spanChildren.add(const TextSpan(text: '\n'));
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, BoxConstraints box) {
|
||||
@@ -132,7 +132,7 @@ class _ContentState extends State<Content> {
|
||||
),
|
||||
);
|
||||
}
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, BoxConstraints box) {
|
||||
@@ -163,7 +163,7 @@ class _ContentState extends State<Content> {
|
||||
);
|
||||
}
|
||||
return TextSpan(
|
||||
children: spanChilds,
|
||||
children: spanChildren,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ InlineSpan richNode(item, context) {
|
||||
try {
|
||||
TextStyle authorStyle =
|
||||
TextStyle(color: Theme.of(context).colorScheme.primary);
|
||||
List<InlineSpan> spanChilds = [];
|
||||
List<InlineSpan> spanChildren = [];
|
||||
|
||||
dynamic richTextNodes;
|
||||
if (item.modules.moduleDynamic.desc != null) {
|
||||
@@ -20,7 +20,7 @@ InlineSpan richNode(item, context) {
|
||||
richTextNodes =
|
||||
item.modules.moduleDynamic.major.opus.summary.richTextNodes;
|
||||
if (item.modules.moduleDynamic.major.opus.title != null) {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: item.modules.moduleDynamic.major.opus.title + '\n',
|
||||
style: Theme.of(context)
|
||||
@@ -39,12 +39,12 @@ InlineSpan richNode(item, context) {
|
||||
// if (item.modules.moduleDynamic.major.opus.title == null &&
|
||||
// i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_TEXT') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(text: i.origText, style: const TextStyle(height: 1.65)));
|
||||
}
|
||||
// @用户
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_AT') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Row(
|
||||
@@ -65,7 +65,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 话题
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_TOPIC') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -80,7 +80,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 网页链接
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_WEB') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Icon(
|
||||
@@ -90,7 +90,7 @@ InlineSpan richNode(item, context) {
|
||||
),
|
||||
),
|
||||
);
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -114,7 +114,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 投票
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_VOTE') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -142,7 +142,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 表情
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_EMOJI') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: NetworkImgLayer(
|
||||
src: i.emoji.iconUrl,
|
||||
@@ -155,7 +155,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 抽奖
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_LOTTERY') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Icon(
|
||||
@@ -165,7 +165,7 @@ InlineSpan richNode(item, context) {
|
||||
),
|
||||
),
|
||||
);
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -181,7 +181,7 @@ InlineSpan richNode(item, context) {
|
||||
|
||||
/// TODO 商品
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_GOODS') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Icon(
|
||||
@@ -191,7 +191,7 @@ InlineSpan richNode(item, context) {
|
||||
),
|
||||
),
|
||||
);
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -206,7 +206,7 @@ InlineSpan richNode(item, context) {
|
||||
}
|
||||
// 投稿
|
||||
if (i.type == 'RICH_TEXT_NODE_TYPE_BV') {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: Icon(
|
||||
@@ -216,7 +216,7 @@ InlineSpan richNode(item, context) {
|
||||
),
|
||||
),
|
||||
);
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
alignment: PlaceholderAlignment.middle,
|
||||
child: GestureDetector(
|
||||
@@ -248,8 +248,8 @@ InlineSpan richNode(item, context) {
|
||||
// if (len == 1) {
|
||||
// OpusPicsModel pictureItem = pics.first;
|
||||
// picList.add(pictureItem.url!);
|
||||
// spanChilds.add(const TextSpan(text: '\n'));
|
||||
// spanChilds.add(
|
||||
// spanChildren.add(const TextSpan(text: '\n'));
|
||||
// spanChildren.add(
|
||||
// WidgetSpan(
|
||||
// child: LayoutBuilder(
|
||||
// builder: (context, BoxConstraints box) {
|
||||
@@ -309,7 +309,7 @@ InlineSpan richNode(item, context) {
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// spanChilds.add(
|
||||
// spanChildren.add(
|
||||
// WidgetSpan(
|
||||
// child: LayoutBuilder(
|
||||
// builder: (context, BoxConstraints box) {
|
||||
@@ -339,7 +339,7 @@ InlineSpan richNode(item, context) {
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// spanChilds.add(
|
||||
// spanChildren.add(
|
||||
// WidgetSpan(
|
||||
// child: NetworkImgLayer(
|
||||
// src: pics.first.url,
|
||||
@@ -351,7 +351,7 @@ InlineSpan richNode(item, context) {
|
||||
// );
|
||||
// }
|
||||
return TextSpan(
|
||||
children: spanChilds,
|
||||
children: spanChildren,
|
||||
);
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
@@ -22,7 +22,7 @@ class _UpPanelState extends State<UpPanel> {
|
||||
int currentMid = -1;
|
||||
List<UpItem> upList = [];
|
||||
List<LiveUserItem> liveList = [];
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
var userInfo;
|
||||
bool _showLiveItems = false;
|
||||
late DynamicsController dynamicsController;
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPalaX/models/fans/result.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
class FansController extends GetxController {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
int pn = 1;
|
||||
int ps = 20;
|
||||
int total = 0;
|
||||
|
||||
@@ -10,7 +10,7 @@ import 'package:PiliPalaX/utils/storage.dart';
|
||||
class FavController extends GetxController {
|
||||
final ScrollController scrollController = ScrollController();
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
int currentPage = 1;
|
||||
int pageSize = 10;
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:PiliPalaX/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;
|
||||
|
||||
@@ -11,7 +11,7 @@ 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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPalaX/pages/mine/view.dart';
|
||||
import 'package:PiliPalaX/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 {
|
||||
late ReplySortType _sortType;
|
||||
late RxString sortTypeTitle;
|
||||
late RxString sortTypeLabel;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -13,7 +13,7 @@ class LiveController extends GetxController {
|
||||
RxList<LiveItemModel> liveList = <LiveItemModel>[].obs;
|
||||
bool flag = false;
|
||||
OverlayEntry? popupDialog;
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -72,7 +72,7 @@ class LiveRoomController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
void setVolumn(value) {
|
||||
void setVolume(value) {
|
||||
if (value == 0) {
|
||||
// 设置音量
|
||||
volumeOff.value = false;
|
||||
|
||||
@@ -33,7 +33,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() {
|
||||
|
||||
@@ -26,12 +26,12 @@ class MainController extends GetxController {
|
||||
RxList navigationBars = defaultNavigationBars.obs;
|
||||
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;
|
||||
RxBool userLogin = false.obs;
|
||||
late DynamicBadgeMode dynamicBadgeType;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
final MediaController _mediaController = Get.put(MediaController());
|
||||
|
||||
int? _lastSelectTime; //上次点击时间
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late bool enableMYBar;
|
||||
late bool useSideBar;
|
||||
late bool enableGradientBg;
|
||||
@@ -101,7 +101,7 @@ class _MainAppState extends State<MainApp> with SingleTickerProviderStateMixin {
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
await GStrorage.close();
|
||||
await GStorage.close();
|
||||
EventBus().off(EventName.loginEvent);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
class MediaController extends GetxController {
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
RxBool userLogin = false.obs;
|
||||
List list = [
|
||||
{
|
||||
@@ -61,7 +61,7 @@ class MediaController extends GetxController {
|
||||
var res = await await UserHttp.userfavFolder(
|
||||
pn: 1,
|
||||
ps: 5,
|
||||
mid: mid ?? GStrorage.userInfo.get('userInfoCache').mid,
|
||||
mid: mid ?? GStorage.userInfo.get('userInfoCache').mid,
|
||||
);
|
||||
favFolderData.value = res['data'];
|
||||
return res;
|
||||
|
||||
@@ -20,7 +20,7 @@ class MemberController extends GetxController {
|
||||
late Map userStat;
|
||||
RxString face = ''.obs;
|
||||
String? heroTag;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
late int ownerMid;
|
||||
bool specialFollowed = false;
|
||||
// 投稿列表
|
||||
|
||||
@@ -215,7 +215,7 @@ class _MemberPageState extends State<MemberPage>
|
||||
if (snapshot.data['status']) {
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['data'].seasonsList.isEmpty) {
|
||||
return commenWidget('用户没有设置专栏');
|
||||
return commonWidget('用户没有设置专栏');
|
||||
} else {
|
||||
return MemberSeasonsPanel(data: data['data']);
|
||||
}
|
||||
@@ -450,7 +450,7 @@ class _MemberPageState extends State<MemberPage>
|
||||
);
|
||||
}
|
||||
|
||||
Widget commenWidget(msg) {
|
||||
Widget commonWidget(msg) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
top: 20,
|
||||
|
||||
@@ -46,7 +46,7 @@ class _MemberDynamicsPageState extends State<MemberDynamicsPage> {
|
||||
}
|
||||
},
|
||||
);
|
||||
dynamicsWaterfallFlow = GStrorage.setting
|
||||
dynamicsWaterfallFlow = GStorage.setting
|
||||
.get(SettingBoxKey.dynamicsWaterfallFlow, defaultValue: true);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ class MineController extends GetxController {
|
||||
// 用户状态 动态、关注、粉丝
|
||||
Rx<UserStat> userStat = UserStat().obs;
|
||||
RxBool userLogin = false.obs;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box setting = GStrorage.setting;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
Box setting = GStorage.setting;
|
||||
Rx<ThemeType> themeType = ThemeType.system.obs;
|
||||
static bool anonymity =
|
||||
GStrorage.setting.get(SettingBoxKey.anonymity, defaultValue: false);
|
||||
GStorage.setting.get(SettingBoxKey.anonymity, defaultValue: false);
|
||||
|
||||
@override
|
||||
onInit() {
|
||||
@@ -131,7 +131,7 @@ class MineController extends GetxController {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
SmartDialog.dismiss();
|
||||
GStrorage.setting
|
||||
GStorage.setting
|
||||
.put(SettingBoxKey.anonymity, true);
|
||||
anonymity = true;
|
||||
SmartDialog.showToast('已设为永久无痕模式');
|
||||
@@ -146,7 +146,7 @@ class MineController extends GetxController {
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
SmartDialog.dismiss();
|
||||
GStrorage.setting
|
||||
GStorage.setting
|
||||
.put(SettingBoxKey.anonymity, false);
|
||||
anonymity = true;
|
||||
SmartDialog.showToast('已设为临时无痕模式');
|
||||
@@ -164,7 +164,7 @@ class MineController extends GetxController {
|
||||
);
|
||||
});
|
||||
} else {
|
||||
GStrorage.setting.put(SettingBoxKey.anonymity, false);
|
||||
GStorage.setting.put(SettingBoxKey.anonymity, false);
|
||||
SmartDialog.show(
|
||||
clickMaskDismiss: false,
|
||||
usePenetrate: true,
|
||||
|
||||
@@ -11,7 +11,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();
|
||||
late bool enableGradientBg;
|
||||
|
||||
@@ -13,7 +13,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';
|
||||
|
||||
@@ -12,7 +12,7 @@ class SSearchController extends GetxController {
|
||||
RxString searchKeyWord = ''.obs;
|
||||
Rx<TextEditingController> controller = TextEditingController().obs;
|
||||
RxList<HotSearchItem> hotSearchList = <HotSearchItem>[].obs;
|
||||
Box historyWord = GStrorage.historyword;
|
||||
Box historyWord = GStorage.historyWord;
|
||||
List<String> historyCacheList = [];
|
||||
RxList<String> historyList = <String>[].obs;
|
||||
RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs;
|
||||
@@ -20,7 +20,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;
|
||||
|
||||
@override
|
||||
|
||||
@@ -91,7 +91,7 @@ class _SearchPanelState extends State<SearchPanel>
|
||||
list: list.value,
|
||||
);
|
||||
case SearchType.media_bangumi:
|
||||
return searchMbangumiPanel(context, ctr, list);
|
||||
return searchBangumiPanel(context, ctr, list);
|
||||
case SearchType.bili_user:
|
||||
return searchUserPanel(context, ctr, list);
|
||||
case SearchType.live_room:
|
||||
|
||||
@@ -11,7 +11,7 @@ import 'package:PiliPalaX/utils/utils.dart';
|
||||
|
||||
import '../../../utils/grid.dart';
|
||||
|
||||
Widget searchMbangumiPanel(BuildContext context, ctr, list) {
|
||||
Widget searchBangumiPanel(BuildContext context, ctr, list) {
|
||||
TextStyle style =
|
||||
TextStyle(fontSize: Theme.of(context).textTheme.labelMedium!.fontSize);
|
||||
return CustomScrollView(
|
||||
|
||||
@@ -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 hiddenSettingUnlocked = false.obs;
|
||||
@@ -117,7 +117,7 @@ class SettingController extends GetxController {
|
||||
}
|
||||
|
||||
// 设置默认启动页
|
||||
seteDefaultHomePage(BuildContext context) async {
|
||||
setDefaultHomePage(BuildContext context) async {
|
||||
int? result = await showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
||||
@@ -19,7 +19,7 @@ class ExtraSetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ExtraSettingState extends State<ExtraSetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
final SettingController settingController = Get.put(SettingController());
|
||||
late dynamic defaultReplySort;
|
||||
late dynamic defaultDynamicType;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -5,18 +5,18 @@ import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPalaX/utils/storage.dart';
|
||||
|
||||
class SetDiaplayMode extends StatefulWidget {
|
||||
const SetDiaplayMode({super.key});
|
||||
class SetDisplayMode extends StatefulWidget {
|
||||
const SetDisplayMode({super.key});
|
||||
|
||||
@override
|
||||
State<SetDiaplayMode> createState() => _SetDiaplayModeState();
|
||||
State<SetDisplayMode> createState() => _SetDisplayModeState();
|
||||
}
|
||||
|
||||
class _SetDiaplayModeState extends State<SetDiaplayMode> {
|
||||
class _SetDisplayModeState extends State<SetDisplayMode> {
|
||||
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,17 +11,17 @@ class FontSizeSelectPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
List<double> list = List.generate(12, (index) => 0.85 + index * 0.05);
|
||||
//[0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25, 1.3, 1.35];
|
||||
late double minsize;
|
||||
late double minSize;
|
||||
late double maxSize;
|
||||
late double currentSize;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
minsize = list.first;
|
||||
minSize = list.first;
|
||||
maxSize = list.last;
|
||||
currentSize =
|
||||
setting.get(SettingBoxKey.defaultTextScale, defaultValue: 1.0);
|
||||
@@ -74,7 +74,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
const Text('小'),
|
||||
Expanded(
|
||||
child: Slider(
|
||||
min: minsize,
|
||||
min: minSize,
|
||||
value: currentSize,
|
||||
max: maxSize,
|
||||
divisions: list.length - 1,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -15,8 +15,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 double longPressSpeedDefault;
|
||||
late List customSpeedsList;
|
||||
|
||||
@@ -20,7 +20,7 @@ class PlaySetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _PlaySettingState extends State<PlaySetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late String defaultSubtitlePreference;
|
||||
late int defaultFullScreenMode;
|
||||
late int defaultBtmProgressBehavior;
|
||||
@@ -31,7 +31,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
defaultFullScreenMode = setting.get(SettingBoxKey.fullScreenMode,
|
||||
defaultValue: FullScreenMode.values.first.code);
|
||||
defaultBtmProgressBehavior = setting.get(SettingBoxKey.btmProgressBehavior,
|
||||
defaultValue: BtmProgresBehavior.values.first.code);
|
||||
defaultValue: BtmProgressBehavior.values.first.code);
|
||||
defaultSubtitlePreference = setting.get(SettingBoxKey.subtitlePreference,
|
||||
defaultValue: SubtitlePreference.values.first.code);
|
||||
}
|
||||
@@ -231,7 +231,7 @@ class _PlaySettingState extends State<PlaySetting> {
|
||||
return SelectDialog<int>(
|
||||
title: '底部进度条展示',
|
||||
value: defaultBtmProgressBehavior,
|
||||
values: BtmProgresBehavior.values.map((e) {
|
||||
values: BtmProgressBehavior.values.map((e) {
|
||||
return {'title': e.description, 'value': e.code};
|
||||
}).toList());
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ class PrivacySetting extends StatefulWidget {
|
||||
|
||||
class _PrivacySettingState extends State<PrivacySetting> {
|
||||
bool userLogin = false;
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
UserInfoData? userInfo;
|
||||
late bool hiddenSettingUnlocked;
|
||||
|
||||
@@ -33,7 +33,7 @@ class _PrivacySettingState extends State<PrivacySetting> {
|
||||
super.initState();
|
||||
userInfo = userInfoCache.get('userInfoCache');
|
||||
userLogin = userInfo != null;
|
||||
hiddenSettingUnlocked = GStrorage.setting
|
||||
hiddenSettingUnlocked = GStorage.setting
|
||||
.get(SettingBoxKey.hiddenSettingUnlocked, defaultValue: false);
|
||||
}
|
||||
|
||||
@@ -256,9 +256,9 @@ class _PrivacySettingState extends State<PrivacySetting> {
|
||||
if (result['status'] &&
|
||||
result['data'].isLogin) {
|
||||
SmartDialog.showToast('登录成功,当前采用「'
|
||||
'${GStrorage.setting.get(SettingBoxKey.defaultRcmdType, defaultValue: 'web')}'
|
||||
'${GStorage.setting.get(SettingBoxKey.defaultRcmdType, defaultValue: 'web')}'
|
||||
'端」推荐');
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
await userInfoCache.put(
|
||||
'userInfoCache', result['data']);
|
||||
final HomeController homeCtr =
|
||||
|
||||
@@ -18,10 +18,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;
|
||||
|
||||
@@ -31,7 +31,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 double maxRowWidth;
|
||||
@@ -343,7 +343,7 @@ class _StyleSettingState extends State<StyleSetting> {
|
||||
),
|
||||
ListTile(
|
||||
dense: false,
|
||||
onTap: () => settingController.seteDefaultHomePage(context),
|
||||
onTap: () => settingController.setDefaultHomePage(context),
|
||||
leading: const Icon(Icons.home_outlined),
|
||||
title: Text('默认启动页', style: titleStyle),
|
||||
subtitle: Obx(() => Text(
|
||||
|
||||
@@ -16,7 +16,7 @@ class VideoSetting extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _VideoSettingState extends State<VideoSetting> {
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
late dynamic defaultVideoQa;
|
||||
late dynamic defaultAudioQa;
|
||||
late dynamic defaultDecode;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -30,7 +30,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;
|
||||
|
||||
@@ -59,9 +59,9 @@ class VideoDetailController extends GetxController
|
||||
RxString hwdec = 'auto-safe'.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 请求楼中楼评论使用
|
||||
|
||||
@@ -51,7 +51,7 @@ class VideoIntroController 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 = [];
|
||||
@@ -461,15 +461,15 @@ class VideoIntroController extends GetxController {
|
||||
// 重新获取视频资源
|
||||
final VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: heroTag);
|
||||
final ReleatedController releatedCtr =
|
||||
Get.find<ReleatedController>(tag: heroTag);
|
||||
final RelatedController relatedCtr =
|
||||
Get.find<RelatedController>(tag: heroTag);
|
||||
videoDetailCtr.bvid = bvid;
|
||||
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
||||
videoDetailCtr.cid.value = cid;
|
||||
videoDetailCtr.danmakuCid.value = cid;
|
||||
videoDetailCtr.queryVideoUrl();
|
||||
releatedCtr.bvid = bvid;
|
||||
releatedCtr.queryRelatedVideo();
|
||||
relatedCtr.bvid = bvid;
|
||||
relatedCtr.queryRelatedVideo();
|
||||
// 重新请求评论
|
||||
try {
|
||||
/// 未渲染回复组件时可能异常
|
||||
|
||||
@@ -128,7 +128,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
late final Map<dynamic, dynamic> videoItem;
|
||||
|
||||
final Box<dynamic> setting = GStrorage.setting;
|
||||
final Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
late final bool loadingStatus; // 加载状态
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ class IntroDetail extends StatelessWidget {
|
||||
// type
|
||||
// 1 普通文本
|
||||
// 2 @用户
|
||||
final List<TextSpan> spanChilds = List.generate(descV2.length, (index) {
|
||||
final List<TextSpan> spanChildren = List.generate(descV2.length, (index) {
|
||||
final currentDesc = descV2[index];
|
||||
switch (currentDesc.type) {
|
||||
case 1:
|
||||
@@ -186,6 +186,6 @@ class IntroDetail extends StatelessWidget {
|
||||
return const TextSpan();
|
||||
}
|
||||
});
|
||||
return TextSpan(children: spanChilds);
|
||||
return TextSpan(children: spanChildren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/http/video.dart';
|
||||
import '../../../../models/model_hot_video_item.dart';
|
||||
|
||||
class ReleatedController extends GetxController {
|
||||
class RelatedController extends GetxController {
|
||||
// 视频aid
|
||||
String bvid = Get.parameters['bvid'] ?? "";
|
||||
// 推荐视频列表
|
||||
|
||||
@@ -18,7 +18,7 @@ class RelatedVideoPanel extends StatefulWidget {
|
||||
|
||||
class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
late ReleatedController _releatedController;
|
||||
late RelatedController _relatedController;
|
||||
late Future _futureBuilder;
|
||||
|
||||
@override
|
||||
@@ -27,8 +27,8 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_releatedController = Get.put(ReleatedController(), tag: widget.heroTag);
|
||||
_futureBuilder = _releatedController.queryRelatedVideo();
|
||||
_relatedController = Get.put(RelatedController(), tag: widget.heroTag);
|
||||
_futureBuilder = _relatedController.queryRelatedVideo();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -44,7 +44,7 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
return const SliverToBoxAdapter(child: SizedBox());
|
||||
}
|
||||
if (snapshot.data!['status'] && snapshot.hasData) {
|
||||
RxList relatedVideoList = _releatedController.relatedVideoList;
|
||||
RxList relatedVideoList = _relatedController.relatedVideoList;
|
||||
// 请求成功
|
||||
return Obx(
|
||||
() => SliverGrid(
|
||||
@@ -65,17 +65,17 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
showPubdate: true,
|
||||
longPress: () {
|
||||
try {
|
||||
_releatedController.popupDialog =
|
||||
_createPopupDialog(_releatedController
|
||||
_relatedController.popupDialog =
|
||||
_createPopupDialog(_relatedController
|
||||
.relatedVideoList[index]);
|
||||
Overlay.of(context)
|
||||
.insert(_releatedController.popupDialog!);
|
||||
.insert(_relatedController.popupDialog!);
|
||||
} catch (err) {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
longPressEnd: () {
|
||||
_releatedController.popupDialog?.remove();
|
||||
_relatedController.popupDialog?.remove();
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -108,10 +108,10 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
|
||||
OverlayEntry _createPopupDialog(videoItem) {
|
||||
return OverlayEntry(
|
||||
builder: (BuildContext context) => AnimatedDialog(
|
||||
closeFn: _releatedController.popupDialog?.remove,
|
||||
closeFn: _relatedController.popupDialog?.remove,
|
||||
child: OverlayPop(
|
||||
videoItem: videoItem,
|
||||
closeFn: _releatedController.popupDialog?.remove),
|
||||
closeFn: _relatedController.popupDialog?.remove),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class VideoReplyController extends GetxController {
|
||||
RxString sortTypeTitle = ReplySortType.time.titles.obs;
|
||||
RxString sortTypeLabel = ReplySortType.time.labels.obs;
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -20,7 +20,7 @@ import 'package:PiliPalaX/utils/utils.dart';
|
||||
import '../../../../../utils/app_scheme.dart';
|
||||
import 'zan.dart';
|
||||
|
||||
Box setting = GStrorage.setting;
|
||||
Box setting = GStorage.setting;
|
||||
|
||||
class ReplyItem extends StatelessWidget {
|
||||
const ReplyItem({
|
||||
@@ -268,7 +268,7 @@ class ReplyItem extends StatelessWidget {
|
||||
)),
|
||||
),
|
||||
// 操作区域
|
||||
bottonAction(context, replyItem!.replyControl),
|
||||
buttonAction(context, replyItem!.replyControl),
|
||||
// 一楼的评论
|
||||
if ((replyItem!.replyControl!.isShow! ||
|
||||
replyItem!.replies!.isNotEmpty) &&
|
||||
@@ -289,7 +289,7 @@ class ReplyItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
// 感谢、回复、复制
|
||||
Widget bottonAction(BuildContext context, replyControl) {
|
||||
Widget buttonAction(BuildContext context, replyControl) {
|
||||
return Row(
|
||||
children: <Widget>[
|
||||
const SizedBox(width: 32),
|
||||
@@ -528,14 +528,14 @@ InlineSpan buildContent(
|
||||
// replyReply 查看二楼回复(回复详情)回调
|
||||
// fReplyItem 父级回复内容,用作二楼回复(回复详情)展示
|
||||
final content = replyItem.content;
|
||||
final List<InlineSpan> spanChilds = <InlineSpan>[];
|
||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||
|
||||
// 投票
|
||||
if (content.vote.isNotEmpty) {
|
||||
content.message.splitMapJoin(RegExp(r"\{vote:.*?\}"),
|
||||
onMatch: (Match match) {
|
||||
// String matchStr = match[0]!;
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: '投票: ${content.vote['title']}',
|
||||
style: TextStyle(
|
||||
@@ -587,7 +587,7 @@ InlineSpan buildContent(
|
||||
final RegExp pattern = RegExp(patternStr);
|
||||
List<String> matchedStrs = [];
|
||||
void addPlainTextSpan(str) {
|
||||
spanChilds.add(TextSpan(
|
||||
spanChildren.add(TextSpan(
|
||||
text: str,
|
||||
));
|
||||
// TextSpan(
|
||||
@@ -606,7 +606,7 @@ InlineSpan buildContent(
|
||||
if (content.emote.containsKey(matchStr)) {
|
||||
// 处理表情
|
||||
final int size = content.emote[matchStr]['meta']['size'];
|
||||
spanChilds.add(WidgetSpan(
|
||||
spanChildren.add(WidgetSpan(
|
||||
child: ExcludeSemantics(
|
||||
child: NetworkImgLayer(
|
||||
src: content.emote[matchStr]['url'],
|
||||
@@ -621,7 +621,7 @@ InlineSpan buildContent(
|
||||
// 处理@用户
|
||||
final String userName = matchStr.substring(1);
|
||||
final int userId = content.atNameToMid[userName];
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: matchStr,
|
||||
style: TextStyle(
|
||||
@@ -640,7 +640,7 @@ InlineSpan buildContent(
|
||||
} else if (RegExp(r'^\b(?:\d+[::])?[0-5]?[0-9][::][0-5]?[0-9]\b$')
|
||||
.hasMatch(matchStr)) {
|
||||
matchStr = matchStr.replaceAll(':', ':');
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: ' $matchStr ',
|
||||
style: isVideoPage
|
||||
@@ -677,7 +677,7 @@ InlineSpan buildContent(
|
||||
addPlainTextSpan(matchStr);
|
||||
return "";
|
||||
}
|
||||
spanChilds.addAll(
|
||||
spanChildren.addAll(
|
||||
[
|
||||
if (content.jumpUrl[matchStr]?['prefix_icon'] != null) ...[
|
||||
WidgetSpan(
|
||||
@@ -721,7 +721,7 @@ InlineSpan buildContent(
|
||||
source: '',
|
||||
dataString: redirectUrl,
|
||||
);
|
||||
PiliSchame.routePush(scheme);
|
||||
PiliScheme.routePush(scheme);
|
||||
// final String pathSegment = Uri.parse(redirectUrl).path;
|
||||
// final String lastPathSegment =
|
||||
// pathSegment.split('/').last;
|
||||
@@ -788,7 +788,7 @@ InlineSpan buildContent(
|
||||
} else if (content
|
||||
.topicsMeta[matchStr.substring(1, matchStr.length - 1)] !=
|
||||
null) {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: matchStr,
|
||||
style: TextStyle(
|
||||
@@ -822,7 +822,7 @@ InlineSpan buildContent(
|
||||
if (unmatchedItems.isNotEmpty) {
|
||||
for (int i = 0; i < unmatchedItems.length; i++) {
|
||||
String patternStr = unmatchedItems[i];
|
||||
spanChilds.addAll(
|
||||
spanChildren.addAll(
|
||||
[
|
||||
if (content.jumpUrl[patternStr]?['prefix_icon'] != null) ...[
|
||||
WidgetSpan(
|
||||
@@ -859,11 +859,11 @@ InlineSpan buildContent(
|
||||
if (content.pictures.isNotEmpty) {
|
||||
final List<String> picList = <String>[];
|
||||
final int len = content.pictures.length;
|
||||
spanChilds.add(const TextSpan(text: '\n'));
|
||||
spanChildren.add(const TextSpan(text: '\n'));
|
||||
if (len == 1) {
|
||||
Map pictureItem = content.pictures.first;
|
||||
picList.add(pictureItem['img_src']);
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints box) {
|
||||
@@ -948,7 +948,7 @@ InlineSpan buildContent(
|
||||
),
|
||||
);
|
||||
}
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
WidgetSpan(
|
||||
child: Semantics(
|
||||
explicitChildNodes: true,
|
||||
@@ -985,7 +985,7 @@ InlineSpan buildContent(
|
||||
|
||||
// 笔记链接
|
||||
if (content.richText.isNotEmpty) {
|
||||
spanChilds.add(
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
text: ' 笔记',
|
||||
style: TextStyle(
|
||||
@@ -1003,8 +1003,8 @@ InlineSpan buildContent(
|
||||
),
|
||||
);
|
||||
}
|
||||
// spanChilds.add(TextSpan(text: matchMember));
|
||||
return TextSpan(children: spanChilds);
|
||||
// spanChildren.add(TextSpan(text: matchMember));
|
||||
return TextSpan(children: spanChildren);
|
||||
}
|
||||
|
||||
class MorePanel extends StatelessWidget {
|
||||
@@ -1111,7 +1111,7 @@ class MorePanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
// 已登录用户才显示删除
|
||||
if (GStrorage.userInfo.get('userInfoCache') != null)
|
||||
if (GStorage.userInfo.get('userInfoCache') != null)
|
||||
ListTile(
|
||||
onTap: () async => await menuActionHandler('delete'),
|
||||
minLeadingWidth: 0,
|
||||
|
||||
@@ -51,7 +51,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
// 自动聚焦
|
||||
_autoFocus();
|
||||
// 监听聚焦状态
|
||||
_focuslistener();
|
||||
_focusListener();
|
||||
}
|
||||
|
||||
_autoFocus() async {
|
||||
@@ -61,7 +61,7 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
||||
}
|
||||
}
|
||||
|
||||
_focuslistener() {
|
||||
_focusListener() {
|
||||
replyContentFocusNode.addListener(() {
|
||||
if (replyContentFocusNode.hasFocus) {
|
||||
setState(() {
|
||||
|
||||
@@ -49,8 +49,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
PlayerStatus playerStatus = PlayerStatus.playing;
|
||||
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 Future _futureBuilderFuture;
|
||||
// 自动退出全屏
|
||||
late bool autoExitFullscreen;
|
||||
@@ -487,12 +487,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
children: [
|
||||
Obx(
|
||||
() {
|
||||
double videoheight = context.width * 9 / 16;
|
||||
final double videowidth = context.width;
|
||||
double videoHeight = context.width * 9 / 16;
|
||||
final double videoWidth = context.width;
|
||||
// print(videoDetailController.tabCtr.index);
|
||||
if (enableVerticalExpand &&
|
||||
plPlayerController?.direction.value == 'vertical') {
|
||||
videoheight = context.width;
|
||||
videoHeight = context.width;
|
||||
}
|
||||
if (MediaQuery.of(context).orientation ==
|
||||
Orientation.landscape &&
|
||||
@@ -521,7 +521,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
removeSafeArea
|
||||
? 0
|
||||
: MediaQuery.of(context).padding.top)
|
||||
: videoheight,
|
||||
: videoHeight,
|
||||
width: context.width,
|
||||
child: PopScope(
|
||||
canPop: isFullScreen.value != true &&
|
||||
@@ -562,8 +562,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
type: 'emote',
|
||||
src: videoDetailController
|
||||
.videoItem['pic'],
|
||||
width: videowidth,
|
||||
height: videoheight,
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -653,16 +653,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
Widget childWhenDisabledAlmostSquareInner = Obx(() {
|
||||
if (enableVerticalExpand &&
|
||||
plPlayerController?.direction.value == 'vertical') {
|
||||
final double videoheight = context.height -
|
||||
final double videoHeight = context.height -
|
||||
(removeSafeArea
|
||||
? 0
|
||||
: (MediaQuery.of(context).padding.top +
|
||||
MediaQuery.of(context).padding.bottom));
|
||||
final double videowidth = videoheight * 9 / 16;
|
||||
final double videoWidth = videoHeight * 9 / 16;
|
||||
return Row(children: [
|
||||
SizedBox(
|
||||
height: videoheight,
|
||||
width: isFullScreen.value == true ? context.width : videowidth,
|
||||
height: videoHeight,
|
||||
width: isFullScreen.value == true ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: isFullScreen.value != true,
|
||||
onPopInvoked: (bool didPop) {
|
||||
@@ -694,8 +694,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: videowidth,
|
||||
height: videoheight,
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -745,19 +745,19 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
),
|
||||
]);
|
||||
}
|
||||
final double videoheight = context.height / 2.5;
|
||||
final double videowidth = context.width;
|
||||
final double videoHeight = context.height / 2.5;
|
||||
final double videoWidth = context.width;
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: videowidth,
|
||||
width: videoWidth,
|
||||
height: isFullScreen.value == true
|
||||
? context.height -
|
||||
(removeSafeArea
|
||||
? 0
|
||||
: (MediaQuery.of(context).padding.top +
|
||||
MediaQuery.of(context).padding.bottom))
|
||||
: videoheight,
|
||||
: videoHeight,
|
||||
child: PopScope(
|
||||
canPop: isFullScreen.value != true,
|
||||
onPopInvoked: (bool didPop) {
|
||||
@@ -789,8 +789,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: videowidth,
|
||||
height: videoheight,
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -833,14 +833,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
Widget childWhenDisabledLandscapeInner = Obx(() {
|
||||
if (enableVerticalExpand &&
|
||||
plPlayerController?.direction.value == 'vertical') {
|
||||
final double videoheight = context.height -
|
||||
final double videoHeight = context.height -
|
||||
(removeSafeArea ? 0 : MediaQuery.of(context).padding.top);
|
||||
final double videowidth = videoheight * 9 / 16;
|
||||
final double videoWidth = videoHeight * 9 / 16;
|
||||
return Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: videoheight,
|
||||
width: isFullScreen.value == true ? context.width : videowidth,
|
||||
height: videoHeight,
|
||||
width: isFullScreen.value == true ? context.width : videoWidth,
|
||||
child: PopScope(
|
||||
canPop: isFullScreen.value != true,
|
||||
onPopInvoked: (bool didPop) {
|
||||
@@ -873,8 +873,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
child: NetworkImgLayer(
|
||||
type: 'emote',
|
||||
src: videoDetailController.videoItem['pic'],
|
||||
width: videowidth,
|
||||
height: videoheight,
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -951,18 +951,18 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
],
|
||||
);
|
||||
}
|
||||
final double videowidth =
|
||||
final double videoWidth =
|
||||
max(context.height / context.width * 1.04, 1 / 2) * context.width;
|
||||
final double videoheight = videowidth * 9 / 16;
|
||||
final double videoHeight = videoWidth * 9 / 16;
|
||||
return Row(
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width:
|
||||
isFullScreen.value == true ? context.width : videowidth,
|
||||
isFullScreen.value == true ? context.width : videoWidth,
|
||||
height:
|
||||
isFullScreen.value == true ? context.height : videoheight,
|
||||
isFullScreen.value == true ? context.height : videoHeight,
|
||||
child: PopScope(
|
||||
canPop: isFullScreen.value != true,
|
||||
onPopInvoked: (bool didPop) {
|
||||
@@ -998,8 +998,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
type: 'emote',
|
||||
src: videoDetailController
|
||||
.videoItem['pic'],
|
||||
width: videowidth,
|
||||
height: videoheight,
|
||||
width: videoWidth,
|
||||
height: videoHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1011,11 +1011,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
))),
|
||||
SizedBox(
|
||||
width:
|
||||
isFullScreen.value == true ? context.width : videowidth,
|
||||
isFullScreen.value == true ? context.width : videoWidth,
|
||||
height: isFullScreen.value == true
|
||||
? 0
|
||||
: context.height -
|
||||
videoheight -
|
||||
videoHeight -
|
||||
(removeSafeArea
|
||||
? 0
|
||||
: MediaQuery.of(context).padding.top),
|
||||
@@ -1041,7 +1041,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
width: isFullScreen.value == true
|
||||
? 0
|
||||
: (context.width -
|
||||
videowidth -
|
||||
videoWidth -
|
||||
(removeSafeArea
|
||||
? 0
|
||||
: (MediaQuery.of(context).padding.left +
|
||||
|
||||
@@ -160,7 +160,7 @@ class AiDetail extends StatelessWidget {
|
||||
// type
|
||||
// 1 普通文本
|
||||
// 2 @用户
|
||||
List<TextSpan> spanChilds = List.generate(descV2.length, (index) {
|
||||
List<TextSpan> spanChildren = List.generate(descV2.length, (index) {
|
||||
final currentDesc = descV2[index];
|
||||
switch (currentDesc.type) {
|
||||
case 1:
|
||||
@@ -226,6 +226,6 @@ class AiDetail extends StatelessWidget {
|
||||
return const TextSpan();
|
||||
}
|
||||
});
|
||||
return TextSpan(children: spanChilds);
|
||||
return TextSpan(children: spanChildren);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,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;
|
||||
double buttonSpace = 8;
|
||||
bool isFullScreen = false;
|
||||
late String heroTag;
|
||||
|
||||
@@ -122,10 +122,10 @@ class WebviewController extends GetxController {
|
||||
final result = await UserHttp.userInfo();
|
||||
if (result['status'] && result['data'].isLogin) {
|
||||
SmartDialog.showToast('登录成功,当前采用「'
|
||||
'${GStrorage.setting.get(SettingBoxKey.defaultRcmdType, defaultValue: 'web')}'
|
||||
'${GStorage.setting.get(SettingBoxKey.defaultRcmdType, defaultValue: 'web')}'
|
||||
'端」推荐');
|
||||
try {
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
await userInfoCache.put('userInfoCache', result['data']);
|
||||
|
||||
final HomeController homeCtr = Get.find<HomeController>();
|
||||
|
||||
@@ -52,7 +52,7 @@ class WhisperController extends GetxController {
|
||||
msgFeedTop[1]["value"] = msgFeedUnread.value.at;
|
||||
msgFeedTop[2]["value"] = msgFeedUnread.value.like;
|
||||
msgFeedTop[3]["value"] = msgFeedUnread.value.sys_msg;
|
||||
if (GStrorage.setting.get(SettingBoxKey.disableLikeMsg, defaultValue: false)) {
|
||||
if (GStorage.setting.get(SettingBoxKey.disableLikeMsg, defaultValue: false)) {
|
||||
msgFeedTop[2]["value"] = -1;
|
||||
msgFeedTop[2]["enabled"] = false;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ class WhisperDetailController extends GetxController {
|
||||
//表情转换图片规则
|
||||
List<dynamic>? eInfos;
|
||||
final TextEditingController replyContentController = TextEditingController();
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
|
||||
@@ -28,7 +28,7 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
||||
late double emoteHeight = 0.0;
|
||||
double keyboardHeight = 0.0; // 键盘高度
|
||||
String toolbarType = 'none';
|
||||
Box userInfoCache = GStrorage.userInfo;
|
||||
Box userInfoCache = GStorage.userInfo;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
||||
@@ -52,7 +52,7 @@ class ChatItem extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool isOwner =
|
||||
item.senderUid == GStrorage.userInfo.get('userInfoCache').mid;
|
||||
item.senderUid == GStorage.userInfo.get('userInfoCache').mid;
|
||||
|
||||
bool isPic = item.msgType == MsgType.pic.value; // 图片
|
||||
bool isText = item.msgType == MsgType.text.value; // 文本
|
||||
|
||||
@@ -26,9 +26,9 @@ import 'package:universal_platform/universal_platform.dart';
|
||||
import '../../models/video/play/subtitle.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;
|
||||
@@ -167,7 +167,7 @@ class PlPlayerController {
|
||||
/// [videoPlayerController] instance of Player
|
||||
Player? get videoPlayerController => _videoPlayerController;
|
||||
|
||||
/// [videoController] instace of Player
|
||||
/// [videoController] instance of Player
|
||||
VideoController? get videoController => _videoController;
|
||||
|
||||
Rx<bool> get isSliderMoving => _isSliderMoving;
|
||||
@@ -640,7 +640,7 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
Future<void> autoEnterFullscreen() async {
|
||||
bool autoEnterFullscreen = GStrorage.setting
|
||||
bool autoEnterFullscreen = GStorage.setting
|
||||
.get(SettingBoxKey.enableAutoEnter, defaultValue: false);
|
||||
if (autoEnterFullscreen) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
@@ -735,7 +735,7 @@ class PlPlayerController {
|
||||
}),
|
||||
onPositionChanged.listen((event) {
|
||||
EasyThrottle.throttle(
|
||||
'mediaServicePositon',
|
||||
'mediaServicePosition',
|
||||
const Duration(seconds: 1),
|
||||
() => videoPlayerServiceHandler.onPositionChange(event));
|
||||
}),
|
||||
@@ -951,10 +951,10 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> setBrightness(double brightnes) async {
|
||||
Future<void> setBrightness(double brightness) async {
|
||||
try {
|
||||
brightness.value = brightnes;
|
||||
ScreenBrightness().setScreenBrightness(brightnes);
|
||||
this.brightness.value = brightness;
|
||||
ScreenBrightness().setScreenBrightness(brightness);
|
||||
// setVideoBrightness();
|
||||
} catch (e) {
|
||||
throw 'Failed to set brightness';
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
// ignore: camel_case_types
|
||||
enum BtmProgresBehavior {
|
||||
enum BtmProgressBehavior {
|
||||
alwaysShow,
|
||||
alwaysHide,
|
||||
onlyShowFullScreen,
|
||||
onlyHideFullScreen,
|
||||
}
|
||||
|
||||
extension BtmProgresBehaviorDesc on BtmProgresBehavior {
|
||||
extension BtmProgresBehaviorDesc on BtmProgressBehavior {
|
||||
String get description => ['始终展示', '始终隐藏', '仅全屏时展示', '仅全屏时隐藏'][index];
|
||||
}
|
||||
|
||||
extension BtmProgresBehaviorCode on BtmProgresBehavior {
|
||||
extension BtmProgresBehaviorCode on BtmProgressBehavior {
|
||||
static final List<int> _codeList = [0, 1, 2, 3];
|
||||
int get code => _codeList[index];
|
||||
|
||||
static BtmProgresBehavior? fromCode(int code) {
|
||||
static BtmProgressBehavior? fromCode(int code) {
|
||||
final index = _codeList.indexOf(code);
|
||||
if (index != -1) {
|
||||
return BtmProgresBehavior.values[index];
|
||||
return BtmProgressBehavior.values[index];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ Future<void> verticalScreen() async {
|
||||
|
||||
//全向
|
||||
Future<void> autoScreen() async {
|
||||
if (!GStrorage.setting
|
||||
if (!GStorage.setting
|
||||
.get(SettingBoxKey.allowRotateScreen, defaultValue: true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,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;
|
||||
@@ -145,7 +145,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
widget.controller.bottomControl = widget.bottomControl;
|
||||
widget.controller.danmuWidget = widget.danmuWidget;
|
||||
defaultBtmProgressBehavior = setting.get(SettingBoxKey.btmProgressBehavior,
|
||||
defaultValue: BtmProgresBehavior.values.first.code);
|
||||
defaultValue: BtmProgressBehavior.values.first.code);
|
||||
enableQuickDouble =
|
||||
setting.get(SettingBoxKey.enableQuickDouble, defaultValue: true);
|
||||
fullScreenGestureReverse = setting
|
||||
@@ -895,15 +895,15 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
return Container();
|
||||
}
|
||||
if (defaultBtmProgressBehavior ==
|
||||
BtmProgresBehavior.alwaysHide.code) {
|
||||
BtmProgressBehavior.alwaysHide.code) {
|
||||
return const SizedBox();
|
||||
}
|
||||
if (defaultBtmProgressBehavior ==
|
||||
BtmProgresBehavior.onlyShowFullScreen.code &&
|
||||
BtmProgressBehavior.onlyShowFullScreen.code &&
|
||||
!_.isFullScreen.value) {
|
||||
return const SizedBox();
|
||||
} else if (defaultBtmProgressBehavior ==
|
||||
BtmProgresBehavior.onlyHideFullScreen.code &&
|
||||
BtmProgressBehavior.onlyHideFullScreen.code &&
|
||||
_.isFullScreen.value) {
|
||||
return const SizedBox();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,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 = [
|
||||
@@ -137,7 +137,7 @@ class Routes {
|
||||
name: '/fontSizeSetting', page: () => const FontSizeSelectPage()),
|
||||
// 屏幕帧率
|
||||
CustomGetPage(
|
||||
name: '/displayModeSetting', page: () => const SetDiaplayMode()),
|
||||
name: '/displayModeSetting', page: () => const SetDisplayMode()),
|
||||
// 关于
|
||||
CustomGetPage(name: '/about', page: () => const AboutPage()),
|
||||
//
|
||||
|
||||
@@ -26,7 +26,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 = true;
|
||||
// PlPlayerController player = PlPlayerController.getInstance();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import 'id_utils.dart';
|
||||
import 'url_utils.dart';
|
||||
import 'utils.dart';
|
||||
|
||||
class PiliSchame {
|
||||
class PiliScheme {
|
||||
static AppScheme appScheme = AppSchemeImpl.getInstance()!;
|
||||
static Future<void> init() async {
|
||||
///
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -4,14 +4,14 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'storage.dart';
|
||||
class Grid {
|
||||
static double maxRowWidth = GStrorage.setting.get(SettingBoxKey.maxRowWidth, defaultValue: 240.0) as double;
|
||||
static double maxRowWidth = GStorage.setting.get(SettingBoxKey.maxRowWidth, defaultValue: 240.0) as double;
|
||||
//
|
||||
// static double calculateActualWidth(BuildContext context, double maxCrossAxisExtent, double crossAxisSpacing, {double? screenWidthOffset}) {
|
||||
// double screenWidth = MediaQuery.of(context).size.width;
|
||||
// if (screenWidthOffset != null) {
|
||||
// screenWidth -= screenWidthOffset;
|
||||
// }
|
||||
// if (GStrorage.setting.get(SettingBoxKey.useSideBar, defaultValue: false) as bool) {
|
||||
// if (GStorage.setting.get(SettingBoxKey.useSideBar, defaultValue: false) as bool) {
|
||||
// screenWidth -= 55;
|
||||
// }
|
||||
// int columnCount = ((screenWidth - crossAxisSpacing) / (maxCrossAxisExtent + crossAxisSpacing)).ceil();
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -7,9 +7,9 @@ import 'package:PiliPalaX/models/search/hot.dart';
|
||||
import 'package:PiliPalaX/models/user/info.dart';
|
||||
import 'global_data.dart';
|
||||
|
||||
class GStrorage {
|
||||
class GStorage {
|
||||
static late final Box<dynamic> userInfo;
|
||||
static late final Box<dynamic> historyword;
|
||||
static late final Box<dynamic> historyWord;
|
||||
static late final Box<dynamic> localCache;
|
||||
static late final Box<dynamic> setting;
|
||||
static late final Box<dynamic> video;
|
||||
@@ -36,7 +36,7 @@ class GStrorage {
|
||||
// 设置
|
||||
setting = await Hive.openBox('setting');
|
||||
// 搜索历史
|
||||
historyword = await Hive.openBox(
|
||||
historyWord = await Hive.openBox(
|
||||
'historyWord',
|
||||
compactionStrategy: (int entries, int deletedEntries) {
|
||||
return deletedEntries > 10;
|
||||
@@ -76,8 +76,8 @@ class GStrorage {
|
||||
// user.close();
|
||||
userInfo.compact();
|
||||
userInfo.close();
|
||||
historyword.compact();
|
||||
historyword.close();
|
||||
historyWord.compact();
|
||||
historyWord.close();
|
||||
localCache.compact();
|
||||
localCache.close();
|
||||
setting.compact();
|
||||
|
||||
@@ -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