mod: remove disliked rcmd

Closes #80

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-01 11:35:01 +08:00
parent 1dd7b9ed0a
commit dda0fc15c7
11 changed files with 124 additions and 96 deletions

View File

@@ -121,10 +121,10 @@ class IntroDetail extends StatelessWidget {
.map(
(item) => SearchText(
fontSize: 13,
searchText: item['tag_name'],
onSelect: (_) => Get.toNamed('/searchResult',
text: item['tag_name'],
onTap: (_) => Get.toNamed('/searchResult',
parameters: {'keyword': item['tag_name']}),
onLongSelect: (_) =>
onLongPress: (_) =>
Utils.copyText(item['tag_name']),
),
)

View File

@@ -128,6 +128,10 @@ class _RcmdPageState extends State<RcmdPage>
? widget.tabType == TabType.rcmd
? VideoCardV(
videoItem: loadingState.response[index],
onRemove: () {
_controller.loadingState.value = LoadingState.success(
(loadingState.response as List)..removeAt(index));
},
)
: LiveCardV(
liveItem: loadingState.response[index],

View File

@@ -217,9 +217,9 @@ class _SearchPageState extends State<SearchPage> with RouteAware {
children: _searchController.historyList
.map(
(item) => SearchText(
searchText: item,
onSelect: _searchController.onClickKeyword,
onLongSelect: _searchController.onLongSelect,
text: item,
onTap: _searchController.onClickKeyword,
onLongPress: _searchController.onLongSelect,
),
)
.toList(),

View File

@@ -1,18 +1,19 @@
import 'package:flutter/material.dart';
class SearchText extends StatelessWidget {
final String? searchText;
final Function? onSelect;
final Function? onLongSelect;
final String text;
final ValueChanged<String>? onTap;
final ValueChanged<String>? onLongPress;
final double? fontSize;
final Color? bgColor;
final Color? textColor;
final TextAlign? textAlign;
const SearchText({
super.key,
this.searchText,
this.onSelect,
this.onLongSelect,
required this.text,
this.onTap,
this.onLongPress,
this.fontSize,
this.bgColor,
this.textColor,
@@ -28,17 +29,17 @@ class SearchText extends StatelessWidget {
padding: EdgeInsets.zero,
child: InkWell(
onTap: () {
onSelect?.call(searchText);
onTap?.call(text);
},
onLongPress: () {
onLongSelect?.call(searchText);
onLongPress?.call(text);
},
borderRadius: BorderRadius.circular(6),
child: Padding(
padding:
const EdgeInsets.only(top: 5, bottom: 5, left: 11, right: 11),
child: Text(
searchText!,
text,
textAlign: textAlign,
style: TextStyle(
fontSize: fontSize,

View File

@@ -283,8 +283,8 @@ class ArticlePanelController extends GetxController {
children: orderFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (_) async {
text: item['label'],
onTap: (_) async {
Get.back();
currentOrderFilterval.value = item['value'];
SmartDialog.dismiss();
@@ -297,7 +297,7 @@ class ArticlePanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentOrderFilterval.value
? Theme.of(context).colorScheme.secondaryContainer
: null,
@@ -317,8 +317,8 @@ class ArticlePanelController extends GetxController {
children: zoneFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (_) async {
text: item['label'],
onTap: (_) async {
Get.back();
currentZoneFilterval.value = item['value'];
SmartDialog.dismiss();
@@ -331,7 +331,7 @@ class ArticlePanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentZoneFilterval.value
? Theme.of(context).colorScheme.secondaryContainer
: null,

View File

@@ -206,8 +206,8 @@ class UserPanelController extends GetxController {
children: orderFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (_) async {
text: item['label'],
onTap: (_) async {
Get.back();
currentOrderFilterval.value = item['value'];
SmartDialog.dismiss();
@@ -221,7 +221,7 @@ class UserPanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentOrderFilterval.value
? Theme.of(context).colorScheme.secondaryContainer
: null,
@@ -241,8 +241,8 @@ class UserPanelController extends GetxController {
children: userTypeFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (_) async {
text: item['label'],
onTap: (_) async {
Get.back();
currentUserTypeFilterval.value = item['value'];
SmartDialog.dismiss();
@@ -255,7 +255,7 @@ class UserPanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentUserTypeFilterval.value
? Theme.of(context).colorScheme.secondaryContainer
: null,

View File

@@ -255,10 +255,10 @@ class VideoPanelController extends GetxController {
builder: (context, setState) {
Widget dateWidget([bool isFirst = true]) {
return SearchText(
searchText:
text:
DateFormat('yyyy-MM-dd').format(isFirst ? pubBegin : pubEnd),
textAlign: TextAlign.center,
onSelect: (text) {
onTap: (text) {
showDatePicker(
context: context,
initialDate: isFirst ? pubBegin : pubEnd,
@@ -303,7 +303,7 @@ class VideoPanelController extends GetxController {
}
});
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: currentPubTimeFilterval == -1 &&
(isFirst ? customPubBegin : customPubEnd)
? Theme.of(context).colorScheme.secondaryContainer
@@ -337,8 +337,8 @@ class VideoPanelController extends GetxController {
children: pubTimeFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (text) async {
text: item['label'],
onTap: (text) async {
Get.back();
currentPubTimeFilterval = item['value'];
SmartDialog.dismiss();
@@ -379,7 +379,7 @@ class VideoPanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentPubTimeFilterval
? Theme.of(context)
.colorScheme
@@ -416,8 +416,8 @@ class VideoPanelController extends GetxController {
children: timeFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (text) async {
text: item['label'],
onTap: (text) async {
Get.back();
currentTimeFilterval = item['value'];
SmartDialog.dismiss();
@@ -430,7 +430,7 @@ class VideoPanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentTimeFilterval
? Theme.of(context)
.colorScheme
@@ -454,8 +454,8 @@ class VideoPanelController extends GetxController {
children: zoneFiltersList
.map(
(item) => SearchText(
searchText: item['label'],
onSelect: (text) async {
text: item['label'],
onTap: (text) async {
Get.back();
currentZoneFilterval = item['value'];
SmartDialog.dismiss();
@@ -468,7 +468,7 @@ class VideoPanelController extends GetxController {
await ctr.onRefresh();
SmartDialog.dismiss();
},
onLongSelect: (_) {},
onLongPress: (_) {},
bgColor: item['value'] == currentZoneFilterval
? Theme.of(context)
.colorScheme

View File

@@ -620,12 +620,12 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
.map(
(item) => SearchText(
fontSize: 13,
searchText: item['tag_name'],
onSelect: (_) => Get.toNamed('/searchResult',
text: item['tag_name'],
onTap: (_) => Get.toNamed('/searchResult',
parameters: {
'keyword': item['tag_name']
}),
onLongSelect: (_) =>
onLongPress: (_) =>
Utils.copyText(item['tag_name']),
),
)

View File

@@ -86,10 +86,10 @@ class IntroDetail extends StatelessWidget {
.map(
(item) => SearchText(
fontSize: 13,
searchText: item['tag_name'],
onSelect: (_) => Get.toNamed('/searchResult',
text: item['tag_name'],
onTap: (_) => Get.toNamed('/searchResult',
parameters: {'keyword': item['tag_name']}),
onLongSelect: (_) =>
onLongPress: (_) =>
Utils.copyText(item['tag_name']),
),
)