Skip to content

Commit

Permalink
add delete fav action to any list
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Nov 21, 2022
1 parent ab603da commit 559be47
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ci/cmd/check_asset/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
releaseFileName = fmt.Sprintf("wax-%v-android-x86_64.apk", version.Code)
}
if strings.HasPrefix(flutterVersion, "2") {
releaseFileName = "old_flutter-" + releaseFileName
releaseFileName = "z-old_flutter-" + releaseFileName
}
// get version
getReleaseRequest, err := http.NewRequest(
Expand Down
2 changes: 1 addition & 1 deletion ci/cmd/upload_asset/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func main() {
contentType = "application/octet-stream"
}
if strings.HasPrefix(flutterVersion, "2") {
releaseFileName = "old_flutter-" + releaseFileName
releaseFileName = "z-old_flutter-" + releaseFileName
}
releaseFilePath = path.Join("..", releaseFilePath)
info, err := os.Stat(releaseFilePath)
Expand Down
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.6
v1.1.7
4 changes: 4 additions & 0 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v1.1.7

- [x] 🚀修复删除收藏在一些列表模式下不显示

v1.1.6

- [x] 🚀登录后可收藏漫画
25 changes: 17 additions & 8 deletions lib/screens/components/comic_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,7 @@ class _ComicListState extends State<ComicList> {
url: widget.data[i].cover,
width: constraints.maxWidth,
height: constraints.maxHeight,
addLongPressMenus: widget.data[i].favouriteId > 0
? [
TextMenu(
"删除收藏",
deleteAction(widget.data[i]),
),
]
: null,
addLongPressMenus: _buildDeleteMenu(widget.data[i]),
);
},
),
Expand Down Expand Up @@ -174,6 +167,7 @@ class _ComicListState extends State<ComicList> {
setState(() {});
};
widgets.add(GestureDetector(
onLongPress: _buildDeleteDialog(widget.data[i]),
onTap: callback,
child: Stack(children: [
ComicInfoCard(widget.data[i]),
Expand Down Expand Up @@ -233,6 +227,7 @@ class _ComicListState extends State<ComicList> {
setState(() {});
};
widgets.add(GestureDetector(
onLongPress: _buildDeleteDialog(widget.data[i]),
onTap: callback,
child: Stack(children: [
Card(
Expand All @@ -242,6 +237,7 @@ class _ComicListState extends State<ComicList> {
url: widget.data[i].cover,
width: constraints.maxWidth,
height: constraints.maxHeight,
addLongPressMenus: _buildDeleteMenu(widget.data[i]),
);
return Stack(
children: [
Expand Down Expand Up @@ -345,6 +341,7 @@ class _ComicListState extends State<ComicList> {
setState(() {});
};
widgets.add(GestureDetector(
onLongPress: _buildDeleteDialog(widget.data[i]),
onTap: callback,
child: Stack(children: [
Column(
Expand All @@ -360,6 +357,7 @@ class _ComicListState extends State<ComicList> {
url: widget.data[i].cover,
width: constraints.maxWidth,
height: constraints.maxHeight,
addLongPressMenus: _buildDeleteMenu(widget.data[i]),
);
return image;
},
Expand Down Expand Up @@ -460,6 +458,17 @@ class _ComicListState extends State<ComicList> {
return null;
}

List<TextMenu>? _buildDeleteMenu(ComicSimple data) {
return data.favouriteId > 0
? [
TextMenu(
"删除收藏",
deleteAction(data),
),
]
: null;
}

void Function() deleteAction(ComicSimple data) {
return () {
() async {
Expand Down

0 comments on commit 559be47

Please sign in to comment.