Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-21 11:48:42 +08:00
parent 1efd62803a
commit ac60ac417b
130 changed files with 1631 additions and 2132 deletions

View File

@@ -66,18 +66,16 @@ class _FavArticlePageState extends State<FavArticlePage>
}
return FavArticleItem(
item: response[index],
onDelete: () {
showConfirmDialog(
context: context,
title: '确定取消收藏?',
onConfirm: () {
_favArticleController.onRemove(
index,
response[index]['opus_id'],
);
},
);
},
onDelete: () => showConfirmDialog(
context: context,
title: '确定取消收藏?',
onConfirm: () {
_favArticleController.onRemove(
index,
response[index]['opus_id'],
);
},
),
);
},
childCount: response!.length,

View File

@@ -24,15 +24,13 @@ class FavArticleItem extends StatelessWidget {
clipBehavior: Clip.none,
children: [
InkWell(
onTap: () {
Get.toNamed(
'/articlePage',
parameters: {
'id': item['opus_id'],
'type': 'opus',
},
);
},
onTap: () => Get.toNamed(
'/articlePage',
parameters: {
'id': item['opus_id'],
'type': 'opus',
},
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: StyleString.safeSpace,

View File

@@ -90,10 +90,8 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
_favNoteController.handleSelect(
!_favNoteController.allSelected.value);
},
onTap: () => _favNoteController.handleSelect(
!_favNoteController.allSelected.value),
child: const Padding(
padding: EdgeInsets.only(
top: 14,
@@ -154,9 +152,7 @@ class _FavNoteChildPageState extends State<FavNoteChildPage>
return FavNoteItem(
item: response[index],
ctr: _favNoteController,
onSelect: () {
_favNoteController.onSelect(index);
},
onSelect: () => _favNoteController.onSelect(index),
);
},
childCount: response!.length,

View File

@@ -97,10 +97,8 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
),
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
_favPgcController.handleSelect(
!_favPgcController.allSelected.value);
},
onTap: () => _favPgcController
.handleSelect(!_favPgcController.allSelected.value),
child: const Padding(
padding: EdgeInsets.only(
top: 14,
@@ -178,30 +176,26 @@ class _FavPgcChildPageState extends State<FavPgcChildPage>
return FavPgcItem(
item: item,
ctr: _favPgcController,
onSelect: () {
_favPgcController.onSelect(index);
},
onUpdateStatus: () {
showPgcFollowDialog(
context: context,
type: widget.type == 0 ? '追番' : '追剧',
followStatus: widget.followStatus,
onUpdateStatus: (followStatus) {
if (followStatus == -1) {
_favPgcController.bangumiDel(
index,
item.seasonId,
);
} else {
_favPgcController.onUpdate(
index,
followStatus,
item.seasonId,
);
}
},
);
},
onSelect: () => _favPgcController.onSelect(index),
onUpdateStatus: () => showPgcFollowDialog(
context: context,
type: widget.type == 0 ? '追番' : '追剧',
followStatus: widget.followStatus,
onUpdateStatus: (followStatus) {
if (followStatus == -1) {
_favPgcController.bangumiDel(
index,
item.seasonId,
);
} else {
_favPgcController.onUpdate(
index,
followStatus,
item.seasonId,
);
}
},
),
);
},
childCount: response!.length,

View File

@@ -68,24 +68,20 @@ class _FavTopicPageState extends State<FavTopicPage>
color: theme.colorScheme.onInverseSurface,
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: InkWell(
onTap: () {
Get.toNamed(
'/dynTopic',
parameters: {
'id': item.id!.toString(),
'name': item.name!,
},
);
},
onLongPress: () {
showConfirmDialog(
context: context,
title: '确定取消收藏?',
onConfirm: () {
_controller.onRemove(index, item.id);
},
);
},
onTap: () => Get.toNamed(
'/dynTopic',
parameters: {
'id': item.id!.toString(),
'name': item.name!,
},
),
onLongPress: () => showConfirmDialog(
context: context,
title: '确定取消收藏?',
onConfirm: () {
_controller.onRemove(index, item.id);
},
),
borderRadius: const BorderRadius.all(Radius.circular(6)),
child: Container(
alignment: Alignment.centerLeft,

View File

@@ -54,21 +54,19 @@ class _FavPageState extends State<FavPage> with SingleTickerProviderStateMixin {
Obx(
() => _showVideoFavMenu.value
? IconButton(
onPressed: () {
Get.toNamed('/createFav')?.then(
(data) {
if (data != null) {
List<FavFolderItemData> list = _favController
.loadingState.value is Success
? (_favController.loadingState.value as Success)
.response
: <FavFolderItemData>[];
list.insert(list.isNotEmpty ? 1 : 0, data);
_favController.loadingState.refresh();
}
},
);
},
onPressed: () => Get.toNamed('/createFav')?.then(
(data) {
if (data != null) {
List<FavFolderItemData> list = _favController
.loadingState.value is Success
? (_favController.loadingState.value as Success)
.response
: <FavFolderItemData>[];
list.insert(list.isNotEmpty ? 1 : 0, data);
_favController.loadingState.refresh();
}
},
),
icon: const Icon(Icons.add),
tooltip: '新建收藏夹',
)