Skip to content

Commit

Permalink
support delete novel history
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsfsssf committed Apr 29, 2021
1 parent 6674a69 commit cdb7308
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ android {
applicationId packageName
minSdkVersion 21
targetSdkVersion 30
versionCode 10004081
versionName "0.4.8 use"
versionCode 10004090
versionName "0.4.9 Null"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

class Constants {
static String tagName = "0.4.8";
static String tagName = "0.4.9";

// static bool isGooglePlay =
// bool.fromEnvironment("IS_GOOGLEPLAY", defaultValue: false);//为何没用啊咕鸽?
Expand Down
39 changes: 38 additions & 1 deletion lib/page/novel/history/novel_history_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,39 @@ class _NovelHistoryState extends State<NovelHistory> {
Widget build(BuildContext context) {
return Observer(builder: (_) {
return Scaffold(
appBar: AppBar(title: Text(I18n.of(context).history)),
appBar: AppBar(
title: Text(I18n.of(context).history),
),
floatingActionButton: FloatingActionButton(
child: Icon(Icons.delete_forever),
onPressed: () async {
final result = await showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
"${I18n.of(context).delete} ${I18n.of(context).all}?"),
actions: <Widget>[
TextButton(
child: Text(I18n.of(context).cancel),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: Text(I18n.of(context).ok),
onPressed: () {
Navigator.of(context).pop("OK");
},
),
],
);
});
if (result == "OK") {
novelHistoryStore.deleteAll();
}
},
),
body: novelHistoryStore.data.isNotEmpty
? ListView.builder(
itemBuilder: (context, index) {
Expand All @@ -45,6 +77,11 @@ class _NovelHistoryState extends State<NovelHistory> {
subtitle: Text(novel.userName),
onTap: () => Leader.push(
context, NovelViewerPage(id: novel.novelId)),
trailing: IconButton(
icon: Icon(Icons.delete),
onPressed: () {
novelHistoryStore.delete(novel.novelId);
}),
);
},
itemCount: novelHistoryStore.data.length,
Expand Down
2 changes: 1 addition & 1 deletion lib/page/picture/illust_lighting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@ class _IllustLightingPageState extends State<IllustLightingPage>
if (result is Map) {
LPrinter.d(result);
String restrict = result['restrict'];
List<String> tags = result['tags'];
List<String>? tags = result['tags'];
_illustStore.star(restrict: restrict, tags: tags);
}
}
Expand Down

0 comments on commit cdb7308

Please sign in to comment.