Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-11 11:21:27 +08:00
parent e7f27e4913
commit 95f1d1485d
26 changed files with 168 additions and 233 deletions

View File

@@ -234,7 +234,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
'img_size': data.imgSize,
'img_src': data.imageUrl,
};
}).toList(),
}),
eagerError: true,
);
SmartDialog.dismiss();

View File

@@ -202,22 +202,20 @@ class LiveRoomController extends GetxController {
if (messages.isEmpty) {
LiveHttp.liveRoomDanmaPrefetch(roomId: roomId).then((v) {
if (v['status']) {
if ((v['data'] as List?)?.isNotEmpty == true) {
if (v['data'] case List list) {
try {
messages.addAll(
(v['data'] as List)
.map(
(obj) => {
'name': obj['user']['base']['name'],
'uid': obj['user']['uid'],
'text': obj['text'],
'emots': obj['emots'],
'uemote': obj['emoticon']['emoticon_unique'] != ""
? obj['emoticon']
: null,
},
)
.toList(),
list.map(
(obj) => {
'name': obj['user']['base']['name'],
'uid': obj['user']['uid'],
'text': obj['text'],
'emots': obj['emots'],
'uemote': obj['emoticon']['emoticon_unique'] != ""
? obj['emoticon']
: null,
},
),
);
WidgetsBinding.instance.addPostFrameCallback(
(_) => scrollToBottom(),

View File

@@ -77,7 +77,7 @@ class MemberFavoriteCtr
firstEnd.value = res.data['data']['has_more'] == false;
if (res.data['data'] != null) {
List<SpaceFavItemModel> list =
(res.data['data']['list'] as List<dynamic>?)
(res.data['data']?['list'] as List<dynamic>?)
?.map((item) => SpaceFavItemModel.fromJson(item))
.toList() ??
<SpaceFavItemModel>[];
@@ -107,7 +107,7 @@ class MemberFavoriteCtr
secondEnd.value = res.data['data']['has_more'] == false;
if (res.data['data'] != null) {
List<SpaceFavItemModel> list =
(res.data['data']['list'] as List<dynamic>?)
(res.data['data']?['list'] as List<dynamic>?)
?.map((item) => SpaceFavItemModel.fromJson(item))
.toList() ??
<SpaceFavItemModel>[];

View File

@@ -3,7 +3,6 @@ import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/models_new/space/space_fav/data.dart';
import 'package:PiliPlus/models_new/space/space_fav/list.dart';
import 'package:PiliPlus/pages/member_favorite/controller.dart';
import 'package:PiliPlus/pages/member_favorite/widget/item.dart';
import 'package:PiliPlus/utils/grid.dart';
@@ -123,7 +122,7 @@ class _MemberFavoriteState extends State<MemberFavorite>
),
controlAffinity: ListTileControlAffinity.leading,
children: [
...(data.mediaListResponse?.list as List<SpaceFavItemModel>).map(
...?data.mediaListResponse?.list?.map(
(item) => SizedBox(
height: 98,
child: MemberFavItem(

View File

@@ -53,9 +53,7 @@ class _SearchAllPanelState
(item) => switch (item) {
SearchVideoItemModel() => SizedBox(
height: 120,
child: VideoCardH(
videoItem: item,
),
child: VideoCardH(videoItem: item),
),
List<SearchPgcItemModel>() =>
item.length == 1

View File

@@ -158,10 +158,10 @@ class _SearchResultPageState extends State<SearchResultPage>
.map(
(item) => switch (item) {
// SearchType.all => SearchAllPanel(
// tag: _tag,
// searchType: item,
// keyword: _searchResultController.keyword,
// ),
// tag: _tag,
// searchType: item,
// keyword: _searchResultController.keyword,
// ),
SearchType.video => SearchVideoPanel(
tag: _tag,
searchType: item,

View File

@@ -535,9 +535,9 @@ List<SettingsModel> get extraSettings => [
return SelectDialog<SuperResolutionType>(
title: '超分辨率',
value: SuperResolutionType.values[Pref.superResolutionType],
values: SuperResolutionType.values.map((e) {
return (e, e.title);
}).toList(),
values: SuperResolutionType.values
.map((e) => (e, e.title))
.toList(),
);
},
);
@@ -935,9 +935,9 @@ List<SettingsModel> get extraSettings => [
return SelectDialog<int>(
title: '评论展示',
value: Pref.replySortType,
values: ReplySortType.values.map((e) {
return (e.index, e.title);
}).toList(),
values: ReplySortType.values
.map((e) => (e.index, e.title))
.toList(),
);
},
);
@@ -961,9 +961,10 @@ List<SettingsModel> get extraSettings => [
return SelectDialog<int>(
title: '动态展示',
value: Pref.defaultDynamicType,
values: DynamicsTabType.values.sublist(0, 4).map((e) {
return (e.index, e.label);
}).toList(),
values: DynamicsTabType.values
.sublist(0, 4)
.map((e) => (e.index, e.label))
.toList(),
);
},
);
@@ -986,9 +987,7 @@ List<SettingsModel> get extraSettings => [
return SelectDialog<MemberTabType>(
title: '用户页默认展示TAB',
value: Pref.memberTab,
values: MemberTabType.values.map((e) {
return (e, e.title);
}).toList(),
values: MemberTabType.values.map((e) => (e, e.title)).toList(),
);
},
);

View File

@@ -223,9 +223,9 @@ List<SettingsModel> get playSettings => [
return SelectDialog<int>(
title: '默认全屏方向',
value: Pref.fullScreenMode,
values: FullScreenMode.values.map((e) {
return (e.index, e.desc);
}).toList(),
values: FullScreenMode.values
.map((e) => (e.index, e.desc))
.toList(),
);
},
);
@@ -248,9 +248,9 @@ List<SettingsModel> get playSettings => [
return SelectDialog<int>(
title: '底部进度条展示',
value: Pref.btmProgressBehavior,
values: BtmProgressBehavior.values.map((e) {
return (e.index, e.desc);
}).toList(),
values: BtmProgressBehavior.values
.map((e) => (e.index, e.desc))
.toList(),
);
},
);

View File

@@ -104,9 +104,7 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<Transition>(
title: '页面过渡动画',
value: CustomGetPage.pageTransition,
values: Transition.values.map((e) {
return (e, e.name);
}).toList(),
values: Transition.values.map((e) => (e, e.name)).toList(),
);
},
);
@@ -203,9 +201,7 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<UpPanelPosition>(
title: '动态页UP主显示位置',
value: Pref.upPanelPosition,
values: UpPanelPosition.values.map((e) {
return (e, e.label);
}).toList(),
values: UpPanelPosition.values.map((e) => (e, e.label)).toList(),
);
},
);
@@ -239,9 +235,7 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<DynamicBadgeMode>(
title: '动态未读标记',
value: Pref.dynamicBadgeType,
values: DynamicBadgeMode.values.map((e) {
return (e, e.desc);
}).toList(),
values: DynamicBadgeMode.values.map((e) => (e, e.desc)).toList(),
);
},
);
@@ -272,9 +266,7 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<DynamicBadgeMode>(
title: '消息未读标记',
value: Pref.msgBadgeMode,
values: DynamicBadgeMode.values.map((e) {
return (e, e.desc);
}).toList(),
values: DynamicBadgeMode.values.map((e) => (e, e.desc)).toList(),
);
},
);
@@ -557,11 +549,7 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<ThemeType>(
title: '主题模式',
value: Pref.themeType,
values: ThemeType.values.map(
(e) {
return (e, e.desc);
},
).toList(),
values: ThemeType.values.map((e) => (e, e.desc)).toList(),
);
},
);
@@ -608,9 +596,9 @@ List<SettingsModel> get styleSettings => [
return SelectDialog<int>(
title: '首页启动页',
value: Pref.defaultHomePage,
values: NavigationBarType.values.map((e) {
return (e.index, e.label);
}).toList(),
values: NavigationBarType.values
.map((e) => (e.index, e.label))
.toList(),
);
},
);

View File

@@ -132,9 +132,9 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<int>(
title: '蜂窝网络画质',
value: Pref.defaultVideoQaCellular,
values: VideoQuality.values.reversed.map((e) {
return (e.code, e.desc);
}).toList(),
values: VideoQuality.values.reversed
.map((e) => (e.code, e.desc))
.toList(),
);
},
);
@@ -185,9 +185,9 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<int>(
title: '蜂窝网络音质',
value: Pref.defaultAudioQaCellular,
values: AudioQuality.values.reversed.map((e) {
return (e.code, e.desc);
}).toList(),
values: AudioQuality.values.reversed
.map((e) => (e.code, e.desc))
.toList(),
);
},
);
@@ -238,9 +238,9 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<int>(
title: '直播默认画质',
value: Pref.liveQualityCellular,
values: LiveQuality.values.map((e) {
return (e.code, e.description);
}).toList(),
values: LiveQuality.values
.map((e) => (e.code, e.description))
.toList(),
);
},
);
@@ -288,9 +288,9 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<String>(
title: '次选解码格式',
value: Pref.secondDecode,
values: VideoDecodeFormatType.values.map((e) {
return (e.code, e.description);
}).toList(),
values: VideoDecodeFormatType.values
.map((e) => (e.code, e.description))
.toList(),
);
},
);
@@ -330,20 +330,17 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<String>(
title: '视频同步',
value: Pref.videoSync,
values:
[
'audio',
'display-resample',
'display-resample-vdrop',
'display-resample-desync',
'display-tempo',
'display-vdrop',
'display-adrop',
'display-desync',
'desync',
].map((e) {
return (e, e);
}).toList(),
values: const [
'audio',
'display-resample',
'display-resample-vdrop',
'display-resample-desync',
'display-tempo',
'display-vdrop',
'display-adrop',
'display-desync',
'desync',
].map((e) => (e, e)).toList(),
);
},
);
@@ -365,9 +362,13 @@ List<SettingsModel> get videoSettings => [
return SelectDialog<String>(
title: '硬解模式',
value: Pref.hardwareDecoding,
values: ['auto', 'auto-copy', 'auto-safe', 'no', 'yes'].map((e) {
return (e, e);
}).toList(),
values: const [
'auto',
'auto-copy',
'auto-safe',
'no',
'yes',
].map((e) => (e, e)).toList(),
);
},
);

View File

@@ -98,9 +98,7 @@ class _SettingsSearchPageState extends SearchState<SettingsSearchPage> {
? const HttpError()
: SliverWaterfallFlow.extent(
maxCrossAxisExtent: Grid.smallCardWidth * 2,
children: [
..._list.map((item) => item.widget),
],
children: _list.map((item) => item.widget).toList(),
),
),
),

View File

@@ -110,44 +110,43 @@ class _AiDetailState extends CommonCollapseSlidePageState<AiConclusionPanel> {
),
),
const SizedBox(height: 6),
if (item.partOutline?.isNotEmpty == true)
...item.partOutline!.map(
(item) => Wrap(
children: [
SelectableText.rich(
TextSpan(
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.onSurface,
height: 1.5,
),
children: [
TextSpan(
text: DurationUtil.formatDuration(
item.timestamp,
),
style: TextStyle(
color: theme.colorScheme.primary,
),
recognizer: TapGestureRecognizer()
..onTap = () {
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
).plPlayerController.seekTo(
Duration(seconds: item.timestamp!),
);
} catch (_) {}
},
),
const TextSpan(text: ' '),
TextSpan(text: item.content!),
],
...?item.partOutline?.map(
(item) => Wrap(
children: [
SelectableText.rich(
TextSpan(
style: TextStyle(
fontSize: 14,
color: theme.colorScheme.onSurface,
height: 1.5,
),
children: [
TextSpan(
text: DurationUtil.formatDuration(
item.timestamp,
),
style: TextStyle(
color: theme.colorScheme.primary,
),
recognizer: TapGestureRecognizer()
..onTap = () {
try {
Get.find<VideoDetailController>(
tag: Get.arguments['heroTag'],
).plPlayerController.seekTo(
Duration(seconds: item.timestamp!),
);
} catch (_) {}
},
),
const TextSpan(text: ' '),
TextSpan(text: item.content!),
],
),
],
),
),
],
),
),
],
);
},

View File

@@ -764,8 +764,7 @@ class VideoDetailController extends GetxController
return segmentModel;
},
)
.toList(),
),
);
// _segmentProgressList
@@ -774,7 +773,7 @@ class VideoDetailController extends GetxController
double start = (e.segment.first / duration).clamp(0.0, 1.0);
double end = (e.segment.second / duration).clamp(0.0, 1.0);
return Segment(start, end, _getColor(e.segmentType));
}).toList(),
}),
);
if (positionSubscription == null &&

View File

@@ -393,7 +393,6 @@ class ReplyItemGrpc extends StatelessWidget {
],
if (replyItem.replyControl.cardLabels
.map((item) => item.textContent)
.toList()
.contains('热评'))
Text(
'热评',

View File

@@ -1641,12 +1641,12 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
onTap: handlePlay,
child: Obx(
() => NetworkImgLayer(
radius: 0,
quality: 60,
src: videoDetailController.cover.value,
width: width,
height: height,
boxFit: BoxFit.cover,
fadeOutDuration: const Duration(milliseconds: 120),
fadeInDuration: const Duration(milliseconds: 120),
forceUseCacheWidth: true,
),
),

View File

@@ -2,10 +2,9 @@ import 'dart:io';
import 'package:PiliPlus/http/ua_type.dart';
import 'package:PiliPlus/models/common/webview_menu_type.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/accounts/account.dart';
import 'package:PiliPlus/utils/app_scheme.dart';
import 'package:PiliPlus/utils/cache_manage.dart';
import 'package:PiliPlus/utils/login_utils.dart';
import 'package:PiliPlus/utils/page_utils.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/foundation.dart' show kDebugMode;
@@ -111,18 +110,7 @@ class _WebviewPageState extends State<WebviewPage> {
}
break;
case WebviewMenuItem.resetCookie:
final cookies = Accounts.main.cookieJar.toList();
for (var item in cookies) {
await CookieManager().setCookie(
url: WebUri(item.domain ?? ''),
name: item.name,
value: item.value,
path: item.path ?? '',
domain: item.domain,
isSecure: item.secure,
isHttpOnly: item.httpOnly,
);
}
await LoginUtils.setWebCookie();
SmartDialog.showToast('设置成功,刷新或重新打开网页');
break;
}