This commit is contained in:
niuhuan 2022-08-11 11:21:55 +08:00
parent 7067003070
commit 8225250df8
8 changed files with 86 additions and 20 deletions

View File

@ -1 +1 @@
v1.5.7 v1.5.8

View File

@ -1,17 +1,3 @@
v1.5.7 v1.5.8
- [x] 升级flutter到3.0.5 - [x] 解决历史记录图片不刷新的问题
- [x] TG群炸了, 换成新的, 在这里通知一下 - [x] 增加退出是增加提示的选项(设置中寻找)
- [x] 更新发电功能, 点击小闪电点我发过电, 不捐助可以发电到8月
v1.5.6
- [x] 从服务器获取最新的分流
- [x] 优化排行榜/骑士榜/以及各个异步加载页的刷新逻辑
- [x] 优化注册表单
v1.5.5
- [x] 对历史记录页面进行优化
- [x] 对导入进行优化
- [x] 增加了批量导出ZIP/PKI到文件夹
- [x] 增加了从一个文件夹中导入所有ZIP/PKI的功能
- [x] 增加了发电页面, 对作者发过电的用户会展示发电特权图标

View File

@ -0,0 +1,41 @@
import 'package:flutter/material.dart';
import '../Common.dart';
import '../Method.dart';
const _propertyName = "willPopNotice";
late bool _willPopNotice;
Future initWillPopNotice() async {
_willPopNotice = (await method.loadProperty(_propertyName, "false")) == "true";
}
bool willPopNotice() {
return _willPopNotice;
}
Future<void> _chooseWillPopNotice(BuildContext context) async {
String? result =
await chooseListDialog<String>(context, "退出APP的提示", ["", ""]);
if (result != null) {
var target = result == "";
await method.saveProperty(_propertyName, "$target");
_willPopNotice = target;
}
}
Widget willPopNoticeSetting() {
return StatefulBuilder(
builder: (BuildContext context, void Function(void Function()) setState) {
return ListTile(
title: const Text("退出APP的提示"),
subtitle: Text(_willPopNotice ? "" : ""),
onTap: () async {
await _chooseWillPopNotice(context);
setState(() {});
},
);
},
);
}

View File

@ -2,7 +2,9 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_styled_toast/flutter_styled_toast.dart';
import 'package:pikapika/basic/config/Version.dart'; import 'package:pikapika/basic/config/Version.dart';
import 'package:pikapika/basic/config/WillPopNotice.dart';
import 'package:pikapika/screens/components/Badge.dart'; import 'package:pikapika/screens/components/Badge.dart';
import 'package:uni_links/uni_links.dart'; import 'package:uni_links/uni_links.dart';
import 'package:uri_to_file/uri_to_file.dart'; import 'package:uri_to_file/uri_to_file.dart';
@ -56,7 +58,7 @@ class _AppScreenState extends State<AppScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( final body = Scaffold(
body: IndexedStack( body: IndexedStack(
index: _selectedIndex, index: _selectedIndex,
children: _widgetOptions, children: _widgetOptions,
@ -82,5 +84,37 @@ class _AppScreenState extends State<AppScreen> {
onTap: _onItemTapped, onTap: _onItemTapped,
), ),
); );
return willPop(body);
}
int _noticeTime = 0;
Widget willPop(Scaffold body) {
return WillPopScope(
child: body,
onWillPop: () async {
if (willPopNotice()) {
final now = DateTime.now().millisecondsSinceEpoch;
if (_noticeTime + 3000 > now) {
return true;
} else {
_noticeTime = now;
showToast(
"再次返回将会退出应用程序",
context: context,
position: StyledToastPosition.center,
animation: StyledToastAnimation.scale,
reverseAnimation: StyledToastAnimation.fade,
duration: const Duration(seconds: 3),
animDuration: const Duration(milliseconds: 300),
curve: Curves.elasticOut,
reverseCurve: Curves.linear,
);
return false;
}
}
return true;
},
);
} }
} }

View File

@ -33,6 +33,7 @@ import 'package:pikapika/basic/config/UsingRightClickPop.dart';
import 'package:pikapika/basic/config/Version.dart'; import 'package:pikapika/basic/config/Version.dart';
import 'package:pikapika/basic/config/VolumeController.dart'; import 'package:pikapika/basic/config/VolumeController.dart';
import 'package:pikapika/basic/config/ShadowCategoriesMode.dart'; import 'package:pikapika/basic/config/ShadowCategoriesMode.dart';
import 'package:pikapika/basic/config/WillPopNotice.dart';
import 'package:pikapika/screens/ComicInfoScreen.dart'; import 'package:pikapika/screens/ComicInfoScreen.dart';
import 'package:pikapika/screens/PkzArchiveScreen.dart'; import 'package:pikapika/screens/PkzArchiveScreen.dart';
import 'package:uni_links/uni_links.dart'; import 'package:uni_links/uni_links.dart';
@ -97,6 +98,7 @@ class _InitScreenState extends State<InitScreen> {
await initAuthentication(); await initAuthentication();
await reloadIsPro(); await reloadIsPro();
autoCheckNewVersion(); autoCheckNewVersion();
await initWillPopNotice();
String? initUrl; String? initUrl;
if (Platform.isAndroid || Platform.isIOS) { if (Platform.isAndroid || Platform.isIOS) {

View File

@ -32,6 +32,7 @@ import 'package:pikapika/screens/components/RightClickPop.dart';
import '../basic/config/Authentication.dart'; import '../basic/config/Authentication.dart';
import '../basic/config/UsingRightClickPop.dart'; import '../basic/config/UsingRightClickPop.dart';
import '../basic/config/WillPopNotice.dart';
import 'CleanScreen.dart'; import 'CleanScreen.dart';
import 'MigrateScreen.dart'; import 'MigrateScreen.dart';
import 'ModifyPasswordScreen.dart'; import 'ModifyPasswordScreen.dart';
@ -88,6 +89,7 @@ class SettingsScreen extends StatelessWidget {
noAnimationSetting(), noAnimationSetting(),
const Divider(), const Divider(),
fullScreenUISetting(), fullScreenUISetting(),
willPopNoticeSetting(),
timeZoneSetting(), timeZoneSetting(),
const Divider(), const Divider(),
autoCleanSecSetting(), autoCleanSecSetting(),

View File

@ -213,6 +213,7 @@ class ViewInfoCard extends StatelessWidget {
Container( Container(
padding: const EdgeInsets.only(right: 10), padding: const EdgeInsets.only(right: 10),
child: RemoteImage( child: RemoteImage(
key: Key("$fileServer:$path"),
fileServer: fileServer, fileServer: fileServer,
path: path, path: path,
width: imageWidth, width: imageWidth,

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.5.7+3 version: 1.5.8+4
environment: environment:
sdk: ">=2.12.0 <3.0.0" sdk: ">=2.12.0 <3.0.0"