-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
327 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v1.3.1 | ||
v1.3.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
v1.3.1 | ||
v1.3.2 | ||
|
||
- [x] 🚀代理设置(包括初始化) | ||
- [x] 🚀鼠标侧键返回 | ||
- [x] 🚀使得导出的zip可预览 | ||
- [x] 🚀登录成功后自动同步发电时间 | ||
- [x] 🚀分离设置和关于 | ||
- [x] 🐛安卓12文件权限 | ||
- [x] 🐛修复收藏夹分类 | ||
- [x] 🐛夜间主题看不清楚输入框的字 | ||
- [x] 🐛修复登录不成功的问题 | ||
- [x] 🚀WebDav同步 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:jasmine/basic/methods.dart'; | ||
import 'package:jasmine/configs/web_dav_url.dart'; | ||
|
||
import '../configs/is_pro.dart'; | ||
import '../configs/web_dav_password.dart'; | ||
import '../configs/web_dav_sync_switch.dart'; | ||
import '../configs/web_dav_username.dart'; | ||
import 'commons.dart'; | ||
|
||
Future webDavSync(BuildContext context) async { | ||
try { | ||
await methods.webDavSync({ | ||
"url": currentWebDavUrl, | ||
"username": currentWebUserName, | ||
"password": currentWebDavPassword, | ||
"direction": "Merge", | ||
}); | ||
defaultToast(context, "WebDav 同步成功"); | ||
} catch (e, s) { | ||
print("$e\n$s"); | ||
defaultToast(context, "WebDav 同步失败 : $e"); | ||
} | ||
} | ||
|
||
Future webDavSyncAuto(BuildContext context) async { | ||
if (currentWebDavSyncSwitch() && isPro) { | ||
await webDavSync(context); | ||
} | ||
} | ||
|
||
var syncing = false; | ||
|
||
Widget webDavSyncClick(BuildContext context) { | ||
return ListTile( | ||
title: const Text("立即同步"), | ||
onTap: () async { | ||
if (syncing) return; | ||
syncing = true; | ||
try { | ||
await webDavSync(context); | ||
} finally { | ||
syncing = false; | ||
} | ||
}, | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
import '../basic/commons.dart'; | ||
import '../basic/methods.dart'; | ||
|
||
late String _currentWebDavPassword; | ||
const _propertyName = "WebDavPassword"; | ||
|
||
String get currentWebDavPassword => _currentWebDavPassword; | ||
|
||
Future<String?> initWebDavPassword() async { | ||
_currentWebDavPassword = await methods.loadProperty(_propertyName); | ||
return null; | ||
} | ||
|
||
String currentWebDavPasswordName() { | ||
return _currentWebDavPassword == "" ? "未设置" : _currentWebDavPassword; | ||
} | ||
|
||
Future<dynamic> inputWebDavPassword(BuildContext context) async { | ||
String? input = await displayTextInputDialog( | ||
context, | ||
src: _currentWebDavPassword, | ||
title: 'WebDAV密码', | ||
hint: '请输入WebDAV密码', | ||
); | ||
if (input != null) { | ||
await methods.saveProperty(_propertyName, input); | ||
_currentWebDavPassword = input; | ||
} | ||
} | ||
|
||
Widget webDavPasswordSetting() { | ||
return StatefulBuilder( | ||
builder: (BuildContext context, void Function(void Function()) setState) { | ||
return ListTile( | ||
title: const Text("WebDAV密码"), | ||
subtitle: Text(currentWebDavPasswordName()), | ||
onTap: () async { | ||
await inputWebDavPassword(context); | ||
setState(() {}); | ||
}, | ||
); | ||
}, | ||
); | ||
} |
Oops, something went wrong.