Skip to content

Commit cdb7308

Browse files
committed
support delete novel history
1 parent 6674a69 commit cdb7308

File tree

4 files changed

+42
-5
lines changed

4 files changed

+42
-5
lines changed

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ android {
8585
applicationId packageName
8686
minSdkVersion 21
8787
targetSdkVersion 30
88-
versionCode 10004081
89-
versionName "0.4.8 use"
88+
versionCode 10004090
89+
versionName "0.4.9 Null"
9090
}
9191
compileOptions {
9292
sourceCompatibility JavaVersion.VERSION_1_8

lib/constants.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
class Constants {
18-
static String tagName = "0.4.8";
18+
static String tagName = "0.4.9";
1919

2020
// static bool isGooglePlay =
2121
// bool.fromEnvironment("IS_GOOGLEPLAY", defaultValue: false);//为何没用啊咕鸽?

lib/page/novel/history/novel_history_page.dart

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,39 @@ class _NovelHistoryState extends State<NovelHistory> {
3535
Widget build(BuildContext context) {
3636
return Observer(builder: (_) {
3737
return Scaffold(
38-
appBar: AppBar(title: Text(I18n.of(context).history)),
38+
appBar: AppBar(
39+
title: Text(I18n.of(context).history),
40+
),
41+
floatingActionButton: FloatingActionButton(
42+
child: Icon(Icons.delete_forever),
43+
onPressed: () async {
44+
final result = await showDialog(
45+
context: context,
46+
builder: (context) {
47+
return AlertDialog(
48+
title: Text(
49+
"${I18n.of(context).delete} ${I18n.of(context).all}?"),
50+
actions: <Widget>[
51+
TextButton(
52+
child: Text(I18n.of(context).cancel),
53+
onPressed: () {
54+
Navigator.of(context).pop();
55+
},
56+
),
57+
TextButton(
58+
child: Text(I18n.of(context).ok),
59+
onPressed: () {
60+
Navigator.of(context).pop("OK");
61+
},
62+
),
63+
],
64+
);
65+
});
66+
if (result == "OK") {
67+
novelHistoryStore.deleteAll();
68+
}
69+
},
70+
),
3971
body: novelHistoryStore.data.isNotEmpty
4072
? ListView.builder(
4173
itemBuilder: (context, index) {
@@ -45,6 +77,11 @@ class _NovelHistoryState extends State<NovelHistory> {
4577
subtitle: Text(novel.userName),
4678
onTap: () => Leader.push(
4779
context, NovelViewerPage(id: novel.novelId)),
80+
trailing: IconButton(
81+
icon: Icon(Icons.delete),
82+
onPressed: () {
83+
novelHistoryStore.delete(novel.novelId);
84+
}),
4885
);
4986
},
5087
itemCount: novelHistoryStore.data.length,

lib/page/picture/illust_lighting_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ class _IllustLightingPageState extends State<IllustLightingPage>
984984
if (result is Map) {
985985
LPrinter.d(result);
986986
String restrict = result['restrict'];
987-
List<String> tags = result['tags'];
987+
List<String>? tags = result['tags'];
988988
_illustStore.star(restrict: restrict, tags: tags);
989989
}
990990
}

0 commit comments

Comments
 (0)