Skip to content

Commit

Permalink
♻️ Upgrade network
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Oct 26, 2023
1 parent 170b4b7 commit b2931a0
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 42 deletions.
2 changes: 1 addition & 1 deletion ci/version.code.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.4.9
v1.5.1
9 changes: 5 additions & 4 deletions ci/version.info.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v1.4.9
v1.5.1

- [x] ✨ Display actors
- [x] ♻️ Hidden comment's html tags
- [x] ✨ Search from title
- [x] ♻️ Network
- [x] 🐛 Fix copy error
- [x] ♻️ Title words setting
- [x] ♻️ Login error tips
2 changes: 2 additions & 0 deletions lib/configs/configs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:jasmine/configs/pager_column_number.dart';
import 'package:jasmine/configs/pager_cover_rate.dart';
import 'package:jasmine/configs/passed.dart';
import 'package:jasmine/configs/proxy.dart';
import 'package:jasmine/configs/search_title_words.dart';
import 'package:jasmine/configs/theme.dart';
import 'package:jasmine/configs/using_right_click_pop.dart';
import 'package:jasmine/configs/volume_key_control.dart';
Expand Down Expand Up @@ -64,4 +65,5 @@ Future initConfigs() async {
await initExportRename();
await initLogin();
await initDisplayJmcode();
await initSearchTitleWords();
}
45 changes: 45 additions & 0 deletions lib/configs/search_title_words.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/// 自动全屏
import 'dart:io';

import 'package:flutter/material.dart';

import '../basic/commons.dart';
import '../basic/methods.dart';

const _propertyName = "searchTitleWords";
late bool _searchTitleWords;

Future<void> initSearchTitleWords() async {
_searchTitleWords =
(await methods.loadProperty(_propertyName)) == "true";
}

bool currentSearchTitleWords() {
return _searchTitleWords;
}

Future<void> _chooseSearchTitleWords(BuildContext context) async {
String? result = await chooseListDialog<String>(context,
title: "标题中的关键字", values: ["是", "否"]);
if (result != null) {
var target = result == "是";
await methods.saveProperty(_propertyName, "$target");
_searchTitleWords = target;
}
}

Widget searchTitleWordsSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("标题中的关键字"),
subtitle: Text(_searchTitleWords ? "是" : "否"),
onTap: () async {
await _chooseSearchTitleWords(context);
setState(() {});
},
);
},
);
}
73 changes: 37 additions & 36 deletions lib/screens/components/comic_info_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:jasmine/basic/entities.dart';
import 'package:jasmine/screens/comic_search_screen.dart';

import '../../configs/display_jmcode.dart';
import '../../configs/search_title_words.dart';
import 'images.dart';

class ComicInfoCard extends StatelessWidget {
Expand Down Expand Up @@ -51,42 +52,42 @@ class ComicInfoCard extends StatelessWidget {
children: [
...link
? [
Text.rich(TextSpan(children: [
true
? TextSpan(
style: titleStyle,
children: titleProcess(comic.name, context),
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, comic.name);
},
)
: TextSpan(
text: comic.name,
style: titleStyle,
children: [],
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, comic.name);
},
),
...currentDisplayJmcode()
? [
TextSpan(
text: " (JM${comic.id})",
style: TextStyle(
fontSize: 13,
color: Colors.orange.shade700,
),
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, "JM${comic.id}");
},
),
]
: [],
])),
]
Text.rich(TextSpan(children: [
currentSearchTitleWords()
? TextSpan(
style: titleStyle,
children: titleProcess(comic.name, context),
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, comic.name);
},
)
: TextSpan(
text: comic.name,
style: titleStyle,
children: [],
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, comic.name);
},
),
...currentDisplayJmcode()
? [
TextSpan(
text: " (JM${comic.id})",
style: TextStyle(
fontSize: 13,
color: Colors.orange.shade700,
),
recognizer: LongPressGestureRecognizer()
..onLongPress = () {
confirmCopy(context, "JM${comic.id}");
},
),
]
: [],
])),
]
: [Text(comic.name, style: titleStyle)],
Container(height: 4),
link
Expand Down
3 changes: 3 additions & 0 deletions lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import '../configs/download_and_export_to.dart';
import '../configs/export_rename.dart';
import '../configs/no_animation.dart';
import '../configs/proxy.dart';
import '../configs/search_title_words.dart';
import '../configs/theme.dart';
import '../configs/using_right_click_pop.dart';
import '../configs/volume_key_control.dart';
Expand Down Expand Up @@ -85,6 +86,8 @@ class _SettingsState extends State<SettingsScreen> {
title: const Text("导出下载到目录(即使没有下载完)"),
),
const Divider(),
searchTitleWordsSetting(),
const Divider(),
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: jasmine comic browser

publish_to: 'none'

version: 1.4.8+18
version: 1.5.1+19

environment:
sdk: ">=2.15.1 <3.0.0"
Expand Down

0 comments on commit b2931a0

Please sign in to comment.