Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-22 11:16:49 +08:00
parent 17568c8c27
commit bc3ce66322
40 changed files with 135 additions and 146 deletions

View File

@@ -15,7 +15,6 @@ class FavPgcItemSkeleton extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -15,7 +15,6 @@ class VideoCardHSkeleton extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -36,7 +36,6 @@ class VideoReplySkeleton extends StatelessWidget {
const EdgeInsets.only(top: 4, left: 57, right: 6, bottom: 6),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
width: 300,

View File

@@ -31,6 +31,7 @@ class VideoCardH extends StatelessWidget {
this.onTap,
this.onLongPress,
this.onViewLater,
this.onRemove,
});
final BaseVideoItemModel videoItem;
final bool showOwner;
@@ -40,6 +41,7 @@ class VideoCardH extends StatelessWidget {
final VoidCallback? onTap;
final VoidCallback? onLongPress;
final ValueChanged<int>? onViewLater;
final VoidCallback? onRemove;
@override
Widget build(BuildContext context) {
@@ -108,7 +110,6 @@ class VideoCardH extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AspectRatio(
@@ -188,6 +189,7 @@ class VideoCardH extends StatelessWidget {
size: 29,
iconSize: 17,
videoItem: videoItem,
onRemove: onRemove,
),
),
],

View File

@@ -245,13 +245,16 @@ class VideoCustomActions {
),
TextButton(
onPressed: () async {
Get.back();
var res = await VideoHttp.relationMod(
mid: videoItem.owner.mid!,
act: 5,
reSrc: 11,
);
Pref.setBlackMid(videoItem.owner.mid!);
Get.back();
if (res['status']) {
Pref.setBlackMid(videoItem.owner.mid!);
onRemove?.call();
}
SmartDialog.showToast(res['msg'] ?? '成功');
},
child: const Text('确认'),

View File

@@ -48,7 +48,6 @@ Widget addWidget(ThemeData theme, DynamicItemModel item, BuildContext context,
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
ugc.title!,

View File

@@ -29,7 +29,6 @@ Widget livePanel(
);
},
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
NetworkImgLayer(
@@ -41,7 +40,6 @@ Widget livePanel(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text(
content.live!.title!,

View File

@@ -344,7 +344,6 @@ Widget module(
height: 110,
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4),

View File

@@ -142,7 +142,6 @@ Widget videoSeasonWidget(
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
if (itemContent.cover != null)
if (floor == 1)

View File

@@ -423,7 +423,6 @@ class _EpisodePanelState extends CommonSlidePageState<EpisodePanel> {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
spacing: 10,
children: [
if (cover?.isNotEmpty == true)

View File

@@ -39,7 +39,6 @@ class FavArticleItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (item.cover != null) ...[

View File

@@ -50,7 +50,6 @@ class FavPgcItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -35,7 +35,6 @@ class FavVideoItem extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -71,7 +71,6 @@ class FavVideoCardH extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -109,7 +109,6 @@ class HistoryItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -169,6 +169,9 @@ class _HotPageState extends CommonPageState<HotPage, HotController>
return VideoCardH(
videoItem: response[index],
showPubdate: true,
onRemove: () => controller.loadingState
..value.data!.removeAt(index)
..refresh(),
);
},
childCount: response!.length,

View File

@@ -77,7 +77,6 @@ class VideoCardHLater extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AspectRatio(

View File

@@ -34,7 +34,6 @@ class FavFolderItem extends StatelessWidget {
},
behavior: HitTestBehavior.opaque,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 12),

View File

@@ -429,7 +429,6 @@ class UserInfoCard extends StatelessWidget {
Column _buildV(BuildContext context, ThemeData theme) => Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Stack(
@@ -522,7 +521,6 @@ class UserInfoCard extends StatelessWidget {
Column _buildH(BuildContext context, ThemeData theme) => Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// _buildHeader(context),

View File

@@ -34,7 +34,6 @@ class MemberArticleItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (item.originImageUrls?.firstOrNull?.isNotEmpty == true) ...[

View File

@@ -65,7 +65,6 @@ class MemberFavItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -35,7 +35,6 @@ class MemberFavItem extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -31,7 +31,6 @@ class SeasonSeriesCard extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -73,7 +73,6 @@ class VideoCardHMemberVideo extends StatelessWidget {
child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints boxConstraints) {
return Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AspectRatio(

View File

@@ -181,7 +181,6 @@ class MineController extends GetxController {
bottom: MediaQuery.paddingOf(context).bottom + 15,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
const Icon(MdiIcons.incognitoOff, size: 20),
const SizedBox(width: 10),

View File

@@ -140,7 +140,6 @@ class _ReplyMePageState extends State<ReplyMePage> {
),
),
subtitle: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 4),

View File

@@ -26,60 +26,56 @@ class _RankPageState extends State<RankPage>
children: [
SizedBox(
width: 64,
child: SingleChildScrollView(
child: ListView(
padding: EdgeInsets.only(
bottom: MediaQuery.paddingOf(context).bottom + 80,
),
child: Column(
children: List.generate(
RankType.values.length,
(index) => IntrinsicHeight(
child: Obx(
() => Ink(
color: index == _rankController.tabIndex.value
? theme.colorScheme.onInverseSurface
: theme.colorScheme.surface,
child: InkWell(
onTap: () {
if (_rankController.tabIndex.value != index) {
_rankController.tabIndex.value = index;
_rankController.tabController.animateTo(index);
} else {
_rankController.animateToTop();
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: double.infinity,
width: 3,
color: index == _rankController.tabIndex.value
? theme.colorScheme.primary
: Colors.transparent,
),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
padding:
const EdgeInsets.symmetric(vertical: 7),
child: Text(
RankType.values[index].label,
style: TextStyle(
color:
index == _rankController.tabIndex.value
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
fontSize: 15,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
children: List.generate(
RankType.values.length,
(index) => IntrinsicHeight(
child: Obx(
() => Material(
color: index == _rankController.tabIndex.value
? theme.colorScheme.onInverseSurface
: theme.colorScheme.surface,
child: InkWell(
onTap: () {
if (_rankController.tabIndex.value != index) {
_rankController.tabIndex.value = index;
_rankController.tabController.animateTo(index);
} else {
_rankController.animateToTop();
}
},
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: double.infinity,
width: 3,
color: index == _rankController.tabIndex.value
? theme.colorScheme.primary
: Colors.transparent,
),
Expanded(
flex: 1,
child: Container(
alignment: Alignment.center,
padding: const EdgeInsets.symmetric(vertical: 7),
child: Text(
RankType.values[index].label,
style: TextStyle(
color: index == _rankController.tabIndex.value
? theme.colorScheme.primary
: theme.colorScheme.onSurface,
fontSize: 15,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
),
],
),
),
),

View File

@@ -79,6 +79,9 @@ class _ZonePageState extends CommonPageState<ZonePage, ZoneController>
return VideoCardH(
videoItem: item,
showPubdate: true,
onRemove: () => controller.loadingState
..value.data!.removeAt(index)
..refresh(),
);
}
return PgcRankItem(item: item);

View File

@@ -24,25 +24,25 @@ class SSearchController extends GetxController {
int initIndex = 0;
// uid
RxBool showUidBtn = false.obs;
final RxBool showUidBtn = false.obs;
late final digitOnlyRegExp = RegExp(r'^\d+$');
// history
late final RxBool recordSearchHistory = Pref.recordSearchHistory.obs;
final RxBool recordSearchHistory = Pref.recordSearchHistory.obs;
late final RxList<String> historyList;
// suggestion
late final bool searchSuggestion = Pref.searchSuggestion;
final bool searchSuggestion = Pref.searchSuggestion;
StreamController<String>? _ctr;
StreamSubscription<String>? _sub;
late final RxList<SearchSuggestItem> searchSuggestList;
// trending
late final bool enableHotKey = Pref.enableHotKey;
final bool enableHotKey = Pref.enableHotKey;
late final Rx<LoadingState<SearchTrendingData>> loadingState;
// rcmd
late final bool enableSearchRcmd = Pref.enableSearchRcmd;
final bool enableSearchRcmd = Pref.enableSearchRcmd;
late final Rx<LoadingState<SearchRcmdData>> recommendData;
@override

View File

@@ -73,35 +73,33 @@ class _SearchPageState extends State<SearchPage> {
onSubmitted: (value) => _searchController.submit(),
),
),
body: SingleChildScrollView(
body: ListView(
padding: MediaQuery.paddingOf(context).copyWith(top: 0),
child: Column(
children: [
if (_searchController.searchSuggestion) _searchSuggest(),
if (context.orientation == Orientation.portrait) ...[
if (_searchController.enableHotKey) hotSearch(theme),
_history(theme),
if (_searchController.enableSearchRcmd) hotSearch(theme, false)
] else
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_searchController.enableHotKey ||
_searchController.enableSearchRcmd)
Expanded(
child: Column(
children: [
if (_searchController.enableHotKey) hotSearch(theme),
if (_searchController.enableSearchRcmd)
hotSearch(theme, false)
],
),
children: [
if (_searchController.searchSuggestion) _searchSuggest(),
if (context.orientation == Orientation.portrait) ...[
if (_searchController.enableHotKey) hotSearch(theme),
_history(theme),
if (_searchController.enableSearchRcmd) hotSearch(theme, false)
] else
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (_searchController.enableHotKey ||
_searchController.enableSearchRcmd)
Expanded(
child: Column(
children: [
if (_searchController.enableHotKey) hotSearch(theme),
if (_searchController.enableSearchRcmd)
hotSearch(theme, false)
],
),
Expanded(child: _history(theme)),
],
),
],
),
),
Expanded(child: _history(theme)),
],
),
],
),
);
}

View File

@@ -113,6 +113,9 @@ class _SearchVideoPanelState extends CommonSearchPanelState<SearchVideoPanel,
return VideoCardH(
videoItem: list[index],
showPubdate: true,
onRemove: () => controller.loadingState
..value.data!.removeAt(index)
..refresh(),
);
},
childCount: list.length,

View File

@@ -213,7 +213,6 @@ List<SettingsModel> get styleSettings => [
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '动态页显示所有已关注UP主',
subtitle: '并以最常访问排序UP',
leading: const Icon(Icons.people_alt_outlined),
setKey: SettingBoxKey.dynamicsShowAllFollowedUp,
defaultVal: false,

View File

@@ -1,3 +1,5 @@
import 'dart:async';
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
import 'package:PiliPlus/pages/setting/models/extra_settings.dart';
import 'package:PiliPlus/pages/setting/models/model.dart';
@@ -7,9 +9,9 @@ import 'package:PiliPlus/pages/setting/models/recommend_settings.dart';
import 'package:PiliPlus/pages/setting/models/style_settings.dart';
import 'package:PiliPlus/pages/setting/models/video_settings.dart';
import 'package:PiliPlus/utils/grid.dart';
import 'package:easy_debounce/easy_throttle.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:stream_transform/stream_transform.dart';
import 'package:waterfall_flow/waterfall_flow.dart';
class SettingsSearchPage extends StatefulWidget {
@@ -30,9 +32,35 @@ class _SettingsSearchPageState extends State<SettingsSearchPage> {
...playSettings,
...styleSettings,
];
late StreamController<String> _ctr;
late StreamSubscription<String> _sub;
@override
void initState() {
super.initState();
_ctr = StreamController<String>();
_sub = _ctr.stream
.debounce(const Duration(milliseconds: 200), trailing: true)
.listen((value) {
if (value.isEmpty) {
_list.clear();
} else {
value = value.toLowerCase();
_list.value = _settings
.where((item) =>
(item.title ?? item.getTitle?.call())
?.toLowerCase()
.contains(value) ||
item.subtitle?.toLowerCase().contains(value) == true)
.toList();
}
});
}
@override
void dispose() {
_sub.cancel();
_ctr.close();
_textEditingController.dispose();
super.dispose();
}
@@ -59,23 +87,7 @@ class _SettingsSearchPageState extends State<SettingsSearchPage> {
autofocus: true,
controller: _textEditingController,
textAlignVertical: TextAlignVertical.center,
onChanged: (value) {
EasyThrottle.throttle(
'searchSettings', const Duration(milliseconds: 200), () {
if (value.isEmpty) {
_list.clear();
} else {
value = value.toLowerCase();
_list.value = _settings
.where((item) =>
(item.title ?? item.getTitle?.call())
?.toLowerCase()
.contains(value) ||
item.subtitle?.toLowerCase().contains(value) == true)
.toList();
}
});
},
onChanged: _ctr.add,
decoration: const InputDecoration(
isDense: true,
hintText: '搜索',

View File

@@ -59,7 +59,6 @@ class SubItem extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -54,7 +54,6 @@ class SubVideoCardH extends StatelessWidget {
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -189,7 +189,6 @@ class _MediaListPanelState
vertical: 5,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AspectRatio(

View File

@@ -102,18 +102,15 @@ class _PostPanelState extends CommonCollapseSlidePageState<PostPanel> {
SingleChildScrollView(
controller: ScrollController(),
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(
bottom: 88 + MediaQuery.paddingOf(context).bottom),
child: Column(
children: [
...List.generate(
list!.length,
(index) {
return _buildItem(theme, index, list![index]);
},
),
SizedBox(
height: 88 + MediaQuery.paddingOf(context).bottom,
),
],
children: List.generate(
list!.length,
(index) {
return _buildItem(theme, index, list![index]);
},
),
),
),
Positioned(

View File

@@ -53,6 +53,9 @@ class _RelatedVideoPanelState extends State<RelatedVideoPanel>
return VideoCardH(
videoItem: response[index],
showPubdate: true,
onRemove: () => _relatedController.loadingState
..value.data!.removeAt(index)
..refresh(),
);
},
childCount: response!.length,

View File

@@ -437,7 +437,7 @@ class ReplyItemGrpc extends StatelessWidget {
final childReply = replies[index];
EdgeInsets padding;
if (length == 1) {
padding = const EdgeInsets.all(8);
padding = const EdgeInsets.fromLTRB(8, 5, 8, 5);
} else {
if (index == 0) {
padding = const EdgeInsets.fromLTRB(8, 8, 8, 4);
@@ -542,8 +542,8 @@ class ReplyItemGrpc extends StatelessWidget {
child: Container(
width: double.infinity,
padding: length == 1
? const EdgeInsets.all(8)
: const EdgeInsets.fromLTRB(8, 4, 8, 8),
? const EdgeInsets.fromLTRB(8, 6, 8, 6)
: const EdgeInsets.fromLTRB(8, 5, 8, 8),
child: Text.rich(
TextSpan(
style: TextStyle(

View File

@@ -42,8 +42,6 @@ class Update {
height: 280,
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(