add game origin url
This commit is contained in:
parent
15435bc602
commit
62c1a38216
|
@ -12,6 +12,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 根据不通系统初始化数据的保存路径
|
||||||
func init() {
|
func init() {
|
||||||
applicationDir, err := os.UserHomeDir()
|
applicationDir, err := os.UserHomeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -574,7 +574,10 @@ class Method {
|
||||||
Future<List<String>> downloadGame(String url) async {
|
Future<List<String>> downloadGame(String url) async {
|
||||||
if (url.startsWith("https://game.eroge.xyz/hhh.php")) {
|
if (url.startsWith("https://game.eroge.xyz/hhh.php")) {
|
||||||
var data = await _flatInvoke("downloadGame", url);
|
var data = await _flatInvoke("downloadGame", url);
|
||||||
return List.of(jsonDecode(data)).map((e) => e.toString()).toList();
|
return [
|
||||||
|
url,
|
||||||
|
...List.of(jsonDecode(data)).map((e) => e.toString()),
|
||||||
|
];
|
||||||
}
|
}
|
||||||
return [url];
|
return [url];
|
||||||
}
|
}
|
||||||
|
@ -675,5 +678,4 @@ class Method {
|
||||||
Future<String> httpGet(String url) async {
|
Future<String> httpGet(String url) async {
|
||||||
return await _flatInvoke("httpGet", url);
|
return await _flatInvoke("httpGet", url);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +1,19 @@
|
||||||
import 'dart:async';
|
/// 导航相关
|
||||||
|
|
||||||
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// 用于监听返回到当前页面的事件
|
||||||
|
// (await Navigator.push 会在子页面pushReplacement时结束阻塞)
|
||||||
final RouteObserver<ModalRoute<void>> routeObserver =
|
final RouteObserver<ModalRoute<void>> routeObserver =
|
||||||
RouteObserver<ModalRoute<void>>();
|
RouteObserver<ModalRoute<void>>();
|
||||||
|
|
||||||
Future<dynamic> navPushOrReplace(
|
// 路径深度计数
|
||||||
BuildContext context, WidgetBuilder builder) async {
|
|
||||||
if (_depth < _depthMax) {
|
|
||||||
return Navigator.push(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: builder),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Navigator.pushReplacement(
|
|
||||||
context,
|
|
||||||
MaterialPageRoute(builder: builder),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var navigatorObserver = _NavigatorObserver();
|
|
||||||
|
|
||||||
const _depthMax = 15;
|
const _depthMax = 15;
|
||||||
var _depth = 0;
|
var _depth = 0;
|
||||||
|
|
||||||
int currentDepth() {
|
var navigatorObserver = _NavigatorObserver();
|
||||||
return _depth;
|
|
||||||
}
|
|
||||||
|
|
||||||
class _NavigatorObserver extends NavigatorObserver {
|
class _NavigatorObserver extends NavigatorObserver {
|
||||||
@override
|
@override
|
||||||
|
@ -44,3 +30,19 @@ class _NavigatorObserver extends NavigatorObserver {
|
||||||
super.didPush(route, previousRoute);
|
super.didPush(route, previousRoute);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 路径达到一定深度的时候使用 pushReplacement
|
||||||
|
Future<dynamic> navPushOrReplace(
|
||||||
|
BuildContext context, WidgetBuilder builder) async {
|
||||||
|
if (_depth < _depthMax) {
|
||||||
|
return Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: builder),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Navigator.pushReplacement(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: builder),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// 显示模式, 仅安卓有效
|
/// 显示模式, 仅安卓有效
|
||||||
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
/// 自动清理
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pikapika/basic/Method.dart';
|
import 'package:pikapika/basic/Method.dart';
|
||||||
|
|
||||||
|
|
||||||
const _autoCleanMap = {
|
const _autoCleanMap = {
|
||||||
"一个月前": "${3600 * 24 * 30}",
|
"一个月前": "${3600 * 24 * 30}",
|
||||||
"一周前": "${3600 * 24 * 7}",
|
"一周前": "${3600 * 24 * 7}",
|
||||||
|
@ -52,7 +53,6 @@ Future<void> _chooseAutoCleanSec(BuildContext context) async {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget autoCleanSecSetting() {
|
Widget autoCleanSecSetting() {
|
||||||
return StatefulBuilder(
|
return StatefulBuilder(
|
||||||
builder: (BuildContext context, void Function(void Function()) setState) {
|
builder: (BuildContext context, void Function(void Function()) setState) {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:pikapika/basic/Entities.dart';
|
import 'package:pikapika/basic/Entities.dart';
|
||||||
import 'package:pikapika/basic/Method.dart';
|
|
||||||
import '../FilePhotoViewScreen.dart';
|
|
||||||
import 'Images.dart';
|
import 'Images.dart';
|
||||||
|
|
||||||
const double _avatarMargin = 5;
|
const double _avatarMargin = 5;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// 提示信息, 组件右上角的小红点
|
||||||
class Badged extends StatelessWidget {
|
class Badged extends StatelessWidget {
|
||||||
final String? badge;
|
final String? badge;
|
||||||
final Widget child;
|
final Widget child;
|
||||||
|
|
Loading…
Reference in New Issue