This commit is contained in:
niuhuan 2021-11-11 10:10:18 +08:00
parent e694e7e706
commit e9e875a4da
5 changed files with 33 additions and 5 deletions

3
.gitignore vendored
View File

@ -53,3 +53,6 @@ app.*.map.json
/go/vendor/ /go/vendor/
ios/build/ ios/build/
# APP
/lib/assets/version.txt

View File

@ -1,13 +1,13 @@
PIKAPI - 漫画客户端 PIKAPI - 漫画客户端
======== ========
[![license](https://img.shields.io/github/license/niuhuan/pikapi-flutter)](https://raw.githubusercontent.com/niuhuan/pikapi-flutter/master/LICENSE) [![license](https://img.shields.io/github/license/niuhuan/pikapi)](https://raw.githubusercontent.com/niuhuan/pikapi/master/LICENSE)
[![releases](https://img.shields.io/github/v/release/niuhuan/pikapi-flutter)](https://github.com/niuhuan/pikapi-flutter/releases) [![releases](https://img.shields.io/github/v/release/niuhuan/pikapi)](https://github.com/niuhuan/pikapi/releases)
[![downloads](https://img.shields.io/github/downloads/niuhuan/pikapi-flutter/total)](https://github.com/niuhuan/pikapi-flutter/releases) [![downloads](https://img.shields.io/github/downloads/niuhuan/pikapi/total)](https://github.com/niuhuan/pikapi/releases)
- 美观易用且无广告的漫画客户端, 能运行在Windows/MacOS/Linux/Android/IOS中。 - 美观易用且无广告的漫画客户端, 能运行在Windows/MacOS/Linux/Android/IOS中。
- 本仓库仅作为学习交流使用, 请您遵守当地法律法规以及开源协议。 - 本仓库仅作为学习交流使用, 请您遵守当地法律法规以及开源协议。
- 您的star和issue是对开发者的莫大鼓励, 可以源仓库下载最新的源码/安装包, 表示支持/提出建议。 - 您的star和issue是对开发者的莫大鼓励, 可以源仓库下载最新的源码/安装包, 表示支持/提出建议。
- 源仓库地址 [https://github.com/niuhuan/pikapi-flutter](https://github.com/niuhuan/pikapi-flutter) - 源仓库地址 [https://github.com/niuhuan/pikapi](https://github.com/niuhuan/pikapi)
## 界面 / 功能 ## 界面 / 功能

View File

@ -0,0 +1,23 @@
import 'dart:async' show Future;
import 'package:flutter/services.dart' show rootBundle;
const _versionAssets = 'lib/assets/version.txt';
RegExp _versionExp = RegExp(r"^v\d+\.\d+.\d+$");
late String _version;
Future initVersion() async {
try {
_version = (await rootBundle.loadString(_versionAssets)).trim();
} catch (e) {
_version = "dirty";
}
}
Future versionCheck() async {
if (_versionExp.hasMatch(_version)) {
} else {
// dirtyVersion
}
// String latestVersion = (await method.httpGet(_versionAddress)).trim();
}

View File

@ -29,7 +29,7 @@ class AboutScreen extends StatelessWidget {
Container( Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Text( child: Text(
'请从软件取得渠道获取更新\n本软件开源, 若您想提出改进建议或者获取源码, 请在开源社区搜索 pikapi-flutter', '请从软件取得渠道获取更新\n本软件开源, 若您想提出改进建议或者获取源码, 请在开源社区搜索 pikapi',
style: TextStyle( style: TextStyle(
height: 1.3, height: 1.3,
), ),

View File

@ -23,6 +23,7 @@ import 'package:pikapi/basic/config/Themes.dart';
import 'package:pikapi/basic/Method.dart'; import 'package:pikapi/basic/Method.dart';
import 'package:pikapi/basic/config/ListLayout.dart'; import 'package:pikapi/basic/config/ListLayout.dart';
import 'package:pikapi/basic/config/TimeOffsetHour.dart'; import 'package:pikapi/basic/config/TimeOffsetHour.dart';
import 'package:pikapi/basic/config/Version.dart';
import 'package:pikapi/basic/config/VolumeController.dart'; import 'package:pikapi/basic/config/VolumeController.dart';
import 'AccountScreen.dart'; import 'AccountScreen.dart';
@ -69,6 +70,7 @@ class _InitScreenState extends State<InitScreen> {
await initAndroidSecureFlag(); await initAndroidSecureFlag();
await initDownloadThreadCount(); await initDownloadThreadCount();
await initConvertToPNG(); await initConvertToPNG();
await initVersion();
// , token失效重新登录, 1 // , token失效重新登录, 1
if (await method.preLogin()) { if (await method.preLogin()) {
// token或username+password有效则直接进入登录好的界面 // token或username+password有效则直接进入登录好的界面