mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
513e716608 | |||
8364b56178 | |||
0d0122be3a | |||
4f1fd8530a | |||
82b8eac989 | |||
95815131fe | |||
f8439a3cb2 | |||
f7a6eb1ac9 | |||
a10e8c05d5 | |||
bd15053c2f | |||
![]() |
86c6f13282 | ||
![]() |
b69d2a0950 | ||
![]() |
c897891b2a | ||
![]() |
3c73439588 | ||
![]() |
2d16502154 | ||
![]() |
294498d8a7 | ||
![]() |
20dfbf5125 | ||
![]() |
63aa4ee8b0 | ||
![]() |
c8d4b3db88 | ||
![]() |
b1e7adb1c5 | ||
![]() |
0143a67fa0 | ||
![]() |
eee1141970 | ||
![]() |
50a69f77b6 | ||
![]() |
790ed54d5b | ||
![]() |
21fe14f88b | ||
![]() |
a03ad12837 | ||
![]() |
426257716f | ||
![]() |
67e01ea69f | ||
![]() |
6cf9ce9c96 | ||
![]() |
593899af8c | ||
![]() |
908c26d764 |
6
.github/generate_ipa.sh
vendored
6
.github/generate_ipa.sh
vendored
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
mkdir -p build/ios/iphoneos/Payload
|
|
||||||
mv build/ios/iphoneos/Runner.app build/ios/iphoneos/Payload
|
|
||||||
cd build/ios/iphoneos/
|
|
||||||
zip -r app-ios.ipa Payload
|
|
20
.github/workflows/ios_simulator.yml
vendored
20
.github/workflows/ios_simulator.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: Build IOS SIMULATOR
|
|
||||||
run-name: Build IOS SIMULATOR
|
|
||||||
on:
|
|
||||||
workflow_dispatch: {}
|
|
||||||
jobs:
|
|
||||||
Build_IOS_SIMULATOR:
|
|
||||||
runs-on: macos-13
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: 'stable'
|
|
||||||
architecture: x64
|
|
||||||
- run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
|
|
||||||
- run: flutter pub get
|
|
||||||
- run: flutter build ios --simulator --no-codesign
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: build_files
|
|
||||||
path: build/ios/iphonesimulator
|
|
23
.github/workflows/linux.yml
vendored
23
.github/workflows/linux.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: Build Linux
|
|
||||||
run-name: Build Linux
|
|
||||||
on:
|
|
||||||
workflow_dispatch: {}
|
|
||||||
jobs:
|
|
||||||
Build_Deb:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: 'stable'
|
|
||||||
architecture: x64
|
|
||||||
- run: |
|
|
||||||
sudo apt-get update -y
|
|
||||||
sudo apt-get install -y ninja-build libgtk-3-dev
|
|
||||||
dart pub global activate flutter_to_debian
|
|
||||||
- run: python3 debian/build.py
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: deb_build
|
|
||||||
path: build/linux/x64/release/debian
|
|
||||||
|
|
197
.github/workflows/main.yml
vendored
197
.github/workflows/main.yml
vendored
@@ -1,40 +1,167 @@
|
|||||||
name: Build IOS
|
name: Build ALL
|
||||||
run-name: Build IOS
|
run-name: Build ALL
|
||||||
on:
|
on:
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build_IOS:
|
|
||||||
runs-on: macos-13
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
channel: 'stable'
|
|
||||||
architecture: x64
|
|
||||||
- run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
|
|
||||||
- run: flutter pub get
|
|
||||||
- run: flutter build ios --release --no-codesign
|
|
||||||
- run: bash .github/generate_ipa.sh
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: app-ios.ipa
|
|
||||||
path: build/ios/iphoneos/app-ios.ipa
|
|
||||||
Build_MacOS:
|
Build_MacOS:
|
||||||
runs-on: macos-13
|
runs-on: macos-15
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
|
flutter-version-file: pubspec.yaml
|
||||||
- run: flutter pub get
|
- run: sudo xcode-select --switch /Applications/Xcode_14.3.1.app
|
||||||
- run: flutter build macos --release
|
- run: flutter pub get
|
||||||
- run: |
|
- run: flutter build macos --release
|
||||||
cd build/macos/Build/Products/Release
|
- run: |
|
||||||
zip -r macos-build.zip pixes.app
|
cd build/macos/Build/Products/Release
|
||||||
- uses: actions/upload-artifact@v4
|
chmod +x pixes.app/Contents/MacOS/pixes
|
||||||
with:
|
zip -r macos.zip pixes.app
|
||||||
name: macos-build.zip
|
- uses: actions/upload-artifact@v4
|
||||||
path: build/macos/Build/Products/Release/macos-build.zip
|
with:
|
||||||
|
name: macos.zip
|
||||||
|
path: build/macos/Build/Products/Release/macos.zip
|
||||||
|
Build_IOS:
|
||||||
|
runs-on: macos-15
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "stable"
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
architecture: x64
|
||||||
|
- run: sudo xcode-select --switch /Applications/Xcode_16.0.app
|
||||||
|
- run: flutter pub get
|
||||||
|
- run: flutter build ios --release --no-codesign
|
||||||
|
- run: |
|
||||||
|
mkdir -p /Users/runner/work/pixes/pixes/build/ios/iphoneos/Payload
|
||||||
|
mv /Users/runner/work/pixes/pixes/build/ios/iphoneos/Runner.app /Users/runner/work/pixes/pixes/build/ios/iphoneos/Payload
|
||||||
|
cd /Users/runner/work/pixes/pixes/build/ios/iphoneos/
|
||||||
|
zip -r pixes-ios.ipa Payload
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: app-ios.ipa
|
||||||
|
path: /Users/runner/work/pixes/pixes/build/ios/iphoneos/pixes-ios.ipa
|
||||||
|
Build_Android:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "stable"
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
architecture: x64
|
||||||
|
- name: Decode and install certificate
|
||||||
|
env:
|
||||||
|
STORE_FILE: ${{ secrets.ANDROID_KEYSTORE }}
|
||||||
|
PROPERTY_FILE: ${{ secrets.ANDROID_KEY_PROPERTIES }}
|
||||||
|
run: |
|
||||||
|
echo "$STORE_FILE" | base64 --decode > android/keystore.jks
|
||||||
|
echo "$PROPERTY_FILE" > android/key.properties
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'oracle'
|
||||||
|
java-version: '17'
|
||||||
|
- run: flutter pub get
|
||||||
|
- run: flutter build apk --release
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: apks
|
||||||
|
path: build/app/outputs/apk/release
|
||||||
|
Build_Windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: install dependencies
|
||||||
|
run: |
|
||||||
|
choco install yq -y
|
||||||
|
pip install httpx
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: "stable"
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
architecture: x64
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
flutter pub get
|
||||||
|
python windows/build.py
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows_build
|
||||||
|
path: build/windows/pixes-*
|
||||||
|
Build_Linux:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
channel: 'stable'
|
||||||
|
flutter-version-file: pubspec.yaml
|
||||||
|
architecture: x64
|
||||||
|
- run: |
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y ninja-build libgtk-3-dev webkit2gtk-4.1
|
||||||
|
dart pub global activate flutter_to_debian
|
||||||
|
- run: python3 debian/build.py
|
||||||
|
- run: dart run flutter_to_arch
|
||||||
|
- run: |
|
||||||
|
sudo rm -rf build/linux/arch/app.tar.gz
|
||||||
|
sudo rm -rf build/linux/arch/pkg
|
||||||
|
sudo rm -rf build/linux/arch/src
|
||||||
|
sudo rm -rf build/linux/arch/PKGBUILD
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: deb_build
|
||||||
|
path: build/linux/x64/release/debian
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: arch_build
|
||||||
|
path: build/linux/arch/
|
||||||
|
|
||||||
|
Release:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [Build_MacOS, Build_IOS, Build_Android, Build_Windows, Build_Linux]
|
||||||
|
if: github.event_name == 'release' # 仅在 push 事件时执行
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: macos.zip
|
||||||
|
path: outputs
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: app-ios.ipa
|
||||||
|
path: outputs
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: apks
|
||||||
|
path: outputs
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: windows_build
|
||||||
|
path: outputs
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: deb_build
|
||||||
|
path: outputs
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: arch_build
|
||||||
|
path: outputs
|
||||||
|
- uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref_name }}
|
||||||
|
files: |
|
||||||
|
outputs/*.ipa
|
||||||
|
outputs/*.dmg
|
||||||
|
outputs/*.apk
|
||||||
|
outputs/*.zip
|
||||||
|
outputs/*.exe
|
||||||
|
outputs/*.deb
|
||||||
|
outputs/*.zst
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.ACTION_GITHUB_TOKEN }}
|
||||||
|
38
README.md
38
README.md
@@ -1,16 +1,42 @@
|
|||||||
# pixes
|
# pixes
|
||||||
|
|
||||||
[](https://flutter.dev/)
|
[](https://flutter.dev/)
|
||||||
[](https://github.com/wgh136/pixes/blob/master/LICENSE)
|
[](https://github.com/wgh136/pixes/blob/master/LICENSE)
|
||||||
[](https://github.com/wgh136/PicaComic/pixes)
|
[](https://github.com/wgh136/pixes)
|
||||||
[](https://github.com/wgh136/pixes/stargazers)
|
[](https://github.com/wgh136/pixes/stargazers)
|
||||||
[](https://t.me/pica_group)
|
|
||||||
|
|
||||||
非官方 Pixiv app, 支持 Windows, Android, iOS, macOS
|
Unofficial Pixiv app, support Windows, Android, iOS, macOS, linux
|
||||||
|
|
||||||
主要功能均已实现
|
All main features are implemented.
|
||||||
|
|
||||||
## 屏幕截图
|
## Download
|
||||||
|
|
||||||
|
Download from [Release](https://github.com/wgh136/pixes/releases)
|
||||||
|
|
||||||
|
## Build from source
|
||||||
|
|
||||||
|
### Install Flutter
|
||||||
|
|
||||||
|
View [Flutter Document](https://flutter.dev/docs/get-started/install)
|
||||||
|
|
||||||
|
### Build Android
|
||||||
|
|
||||||
|
Put your keystore file (`key.jks`, `key.properties`) in `android/`
|
||||||
|
|
||||||
|
Run `flutter build apk`
|
||||||
|
|
||||||
|
### Build iOS/Windows/macOS
|
||||||
|
|
||||||
|
Run `flutter build ios/windows/macos`
|
||||||
|
|
||||||
|
### Build Linux
|
||||||
|
|
||||||
|
Use`python3 debian/build.py` to build deb package
|
||||||
|
|
||||||
|
For other linux distributions, you can use `flutter build linux` to build.
|
||||||
|
You must register the `pixiv` scheme in the `.desktop` file, otherwise the login will not work.
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
<img src="screenshots/1.png" style="width: 400px">
|
<img src="screenshots/1.png" style="width: 400px">
|
||||||
<img src="screenshots/2.png" style="width: 400px">
|
<img src="screenshots/2.png" style="width: 400px">
|
||||||
|
@@ -34,25 +34,19 @@ android {
|
|||||||
ndkVersion flutter.ndkVersion
|
ndkVersion flutter.ndkVersion
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
kotlinOptions{
|
||||||
kotlinOptions {
|
jvmTarget = JavaVersion.VERSION_17
|
||||||
jvmTarget = '1.8'
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main.java.srcDirs += 'src/main/kotlin'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
|
||||||
applicationId "com.github.wgh136.pixes"
|
applicationId "com.github.wgh136.pixes"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion flutter.minSdkVersion
|
minSdkVersion flutter.minSdkVersion
|
||||||
targetSdkVersion 34
|
targetSdk = flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
@@ -74,9 +68,7 @@ android {
|
|||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
signingConfig signingConfigs.release
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
|
||||||
signingConfig signingConfigs.debug
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
<application
|
<application
|
||||||
android:label="pixes"
|
android:label="pixes"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
|
android:enableOnBackInvokedCallback="true"
|
||||||
android:icon="@mipmap/ic_launcher">
|
android:icon="@mipmap/ic_launcher">
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
@@ -48,6 +49,7 @@
|
|||||||
<meta-data
|
<meta-data
|
||||||
android:name="flutterEmbedding"
|
android:name="flutterEmbedding"
|
||||||
android:value="2" />
|
android:value="2" />
|
||||||
|
<meta-data android:name="io.flutter.embedding.android.EnableImpeller" android:value="false"/>
|
||||||
</application>
|
</application>
|
||||||
<!-- Required to query activities that can process text, see:
|
<!-- Required to query activities that can process text, see:
|
||||||
https://developer.android.com/training/package-visibility?hl=en and
|
https://developer.android.com/training/package-visibility?hl=en and
|
||||||
|
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip
|
||||||
|
@@ -19,8 +19,8 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
id "com.android.application" version "7.3.0" apply false
|
id "com.android.application" version "8.2.1" apply false
|
||||||
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
|
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
include ":app"
|
include ":app"
|
||||||
|
Binary file not shown.
@@ -10,7 +10,7 @@
|
|||||||
"History": "历史",
|
"History": "历史",
|
||||||
"Ranking": "排行",
|
"Ranking": "排行",
|
||||||
"Settings": "设置",
|
"Settings": "设置",
|
||||||
"Artworks": "插画",
|
"Artworks": "作品",
|
||||||
"Mangas": "漫画",
|
"Mangas": "漫画",
|
||||||
"Users": "用户",
|
"Users": "用户",
|
||||||
"Search artwork": "搜索作品",
|
"Search artwork": "搜索作品",
|
||||||
@@ -112,7 +112,6 @@
|
|||||||
"Multiple path separators will be automatically replaced with a single": "多个路径分隔符将被自动替换为单个",
|
"Multiple path separators will be automatically replaced with a single": "多个路径分隔符将被自动替换为单个",
|
||||||
"Login": "登录",
|
"Login": "登录",
|
||||||
"You need to complete the login operation in the browser window that will open.": "您需要在打开的浏览器窗口中完成登录操作",
|
"You need to complete the login operation in the browser window that will open.": "您需要在打开的浏览器窗口中完成登录操作",
|
||||||
"I have read and agree to the Terms of Use": "我已阅读并同意使用条款",
|
|
||||||
"Waiting..." : "等待中...",
|
"Waiting..." : "等待中...",
|
||||||
"Waiting for authentication. Please finished in the browser." : "等待验证. 请在浏览器中完成.",
|
"Waiting for authentication. Please finished in the browser." : "等待验证. 请在浏览器中完成.",
|
||||||
"Back" : "返回",
|
"Back" : "返回",
|
||||||
@@ -173,7 +172,19 @@
|
|||||||
"Use an external browser: You can sign in using Google. However, some browsers may not be compatible with the application": "使用外部浏览器: 可以使用Google登录. 但是, 一些浏览器可能与应用程序不兼容",
|
"Use an external browser: You can sign in using Google. However, some browsers may not be compatible with the application": "使用外部浏览器: 可以使用Google登录. 但是, 一些浏览器可能与应用程序不兼容",
|
||||||
"External browser": "外部浏览器",
|
"External browser": "外部浏览器",
|
||||||
"Show comments": "显示评论",
|
"Show comments": "显示评论",
|
||||||
"Show original image": "显示原图"
|
"Show original image": "显示原图",
|
||||||
|
"Illustrations": "插画",
|
||||||
|
"New version available": "新版本可用",
|
||||||
|
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新吗?",
|
||||||
|
"Update": "更新",
|
||||||
|
"Check for updates": "检查更新",
|
||||||
|
"Check for updates on startup": "启动时检查更新",
|
||||||
|
"I understand pixes is a free unofficial application.": "我了解Pixes是一个免费的非官方应用程序",
|
||||||
|
"Related Artworks": "相关作品",
|
||||||
|
"Emphasize artworks from following artists": "强调关注画师的作品",
|
||||||
|
"The border of the artworks will be darker": "作品的边框将被加深",
|
||||||
|
"Initial Page": "初始页面",
|
||||||
|
"Close the pane to apply the settings": "关闭面板以应用设置"
|
||||||
},
|
},
|
||||||
"zh_TW": {
|
"zh_TW": {
|
||||||
"Search": "搜索",
|
"Search": "搜索",
|
||||||
@@ -288,7 +299,6 @@
|
|||||||
"Multiple path separators will be automatically replaced with a single": "多個路徑分隔符號將自動替換為單一",
|
"Multiple path separators will be automatically replaced with a single": "多個路徑分隔符號將自動替換為單一",
|
||||||
"Login": "登錄",
|
"Login": "登錄",
|
||||||
"You need to complete the login operation in the browser window that will open.": "您需要在打開的瀏覽器窗口中完成登錄操作",
|
"You need to complete the login operation in the browser window that will open.": "您需要在打開的瀏覽器窗口中完成登錄操作",
|
||||||
"I have read and agree to the Terms of Use": "我已閱讀並同意使用條款",
|
|
||||||
"Waiting..." : "等待中...",
|
"Waiting..." : "等待中...",
|
||||||
"Waiting for authentication. Please finished in the browser." : "等待驗證. 請在瀏覽器中完成.",
|
"Waiting for authentication. Please finished in the browser." : "等待驗證. 請在瀏覽器中完成.",
|
||||||
"Back" : "返回",
|
"Back" : "返回",
|
||||||
@@ -349,6 +359,18 @@
|
|||||||
"Use an external browser: You can sign in using Google. However, some browsers may not be compatible with the application": "使用外部瀏覽器: 可以使用Google登錄. 但是, 一些瀏覽器可能與應用程序不兼容",
|
"Use an external browser: You can sign in using Google. However, some browsers may not be compatible with the application": "使用外部瀏覽器: 可以使用Google登錄. 但是, 一些瀏覽器可能與應用程序不兼容",
|
||||||
"External browser": "外部瀏覽器",
|
"External browser": "外部瀏覽器",
|
||||||
"Show comments": "顯示評論",
|
"Show comments": "顯示評論",
|
||||||
"Show original image": "顯示原圖"
|
"Show original image": "顯示原圖",
|
||||||
|
"Illustrations": "插畫",
|
||||||
|
"New version available": "新版本可用",
|
||||||
|
"A new version of Pixes is available. Do you want to update now?" : "Pixes有新版本可用. 您要立即更新嗎?",
|
||||||
|
"Update": "更新",
|
||||||
|
"Check for updates": "檢查更新",
|
||||||
|
"Check for updates on startup": "啟動時檢查更新",
|
||||||
|
"I understand pixes is a free unofficial application.": "我了解Pixes是一個免費的非官方應用程序",
|
||||||
|
"Related Artworks": "相關作品",
|
||||||
|
"Emphasize artworks from following artists": "強調關注畫師的作品",
|
||||||
|
"The border of the artworks will be darker": "作品的邊框將被加深",
|
||||||
|
"Initial Page": "初始頁面",
|
||||||
|
"Close the pane to apply the settings": "關閉面板以應用設置"
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -36,6 +36,9 @@ class _Appdata {
|
|||||||
LogicalKeyboardKey.keyG.keyId,
|
LogicalKeyboardKey.keyG.keyId,
|
||||||
],
|
],
|
||||||
"showOriginalImage": false,
|
"showOriginalImage": false,
|
||||||
|
"checkUpdate": true,
|
||||||
|
"emphasizeArtworksFromFollowingArtists": true,
|
||||||
|
"initialPage": 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
bool lock = false;
|
bool lock = false;
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:pixes/appdata.dart';
|
||||||
import 'package:pixes/components/animated_image.dart';
|
import 'package:pixes/components/animated_image.dart';
|
||||||
import 'package:pixes/foundation/app.dart';
|
import 'package:pixes/foundation/app.dart';
|
||||||
import 'package:pixes/foundation/history.dart';
|
import 'package:pixes/foundation/history.dart';
|
||||||
import 'package:pixes/foundation/image_provider.dart';
|
import 'package:pixes/foundation/image_provider.dart';
|
||||||
import 'package:pixes/network/download.dart';
|
import 'package:pixes/network/download.dart';
|
||||||
|
import 'package:pixes/pages/related_page.dart';
|
||||||
import 'package:pixes/utils/translation.dart';
|
import 'package:pixes/utils/translation.dart';
|
||||||
|
|
||||||
import '../network/network.dart';
|
import '../network/network.dart';
|
||||||
@@ -61,33 +63,53 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
|
child: Container(
|
||||||
|
width: width,
|
||||||
|
height: height,
|
||||||
|
padding: const EdgeInsets.symmetric(
|
||||||
|
horizontal: 8.0, vertical: 8.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: width,
|
width: double.infinity,
|
||||||
height: height,
|
height: double.infinity,
|
||||||
padding:
|
padding: EdgeInsets.zero,
|
||||||
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
decoration: BoxDecoration(
|
||||||
child: Card(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
margin: EdgeInsets.zero,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: widget.onTap ??
|
|
||||||
() {
|
|
||||||
context.to(() => IllustPage(widget.illust));
|
|
||||||
},
|
|
||||||
onSecondaryTapUp: showMenu,
|
|
||||||
child: ClipRRect(
|
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
child: AnimatedImage(
|
color: FluentTheme.of(context).cardColor,
|
||||||
image: CachedImageProvider(
|
border: () {
|
||||||
widget.illust.images.first.medium),
|
var emphasis = widget.illust.author.isFollowed &&
|
||||||
fit: BoxFit.cover,
|
appdata.settings[
|
||||||
width: width - 16.0,
|
'emphasizeArtworksFromFollowingArtists'];
|
||||||
height: height - 16.0,
|
var color = emphasis
|
||||||
|
? ColorScheme.of(context).primary
|
||||||
|
: ColorScheme.of(context)
|
||||||
|
.outlineVariant
|
||||||
|
.toOpacity(0.64);
|
||||||
|
var width = emphasis ? 1.6 : 1.0;
|
||||||
|
return Border.all(color: color, width: width);
|
||||||
|
}(),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.zero,
|
||||||
|
child: GestureDetector(
|
||||||
|
onTap: widget.onTap ??
|
||||||
|
() {
|
||||||
|
context.to(() => IllustPage(widget.illust));
|
||||||
|
},
|
||||||
|
onSecondaryTapUp: showMenu,
|
||||||
|
onLongPress: showMenu,
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
|
child: AnimatedImage(
|
||||||
|
image: CachedImageProvider(
|
||||||
|
widget.illust.images.first.medium),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: width - 16.0,
|
||||||
|
height: height - 16.0,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
if (widget.illust.images.length > 1)
|
if (widget.illust.images.length > 1)
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 12,
|
top: 12,
|
||||||
@@ -98,7 +120,7 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FluentTheme.of(context)
|
color: FluentTheme.of(context)
|
||||||
.micaBackgroundColor
|
.micaBackgroundColor
|
||||||
.withOpacity(0.72),
|
.toOpacity(0.72),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
@@ -121,7 +143,7 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context)
|
||||||
.errorContainer
|
.errorContainer
|
||||||
.withOpacity(0.8),
|
.toOpacity(0.8),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
@@ -144,7 +166,7 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context)
|
||||||
.primaryContainer
|
.primaryContainer
|
||||||
.withOpacity(0.8),
|
.toOpacity(0.8),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
@@ -211,13 +233,13 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void showMenu(TapUpDetails details) {
|
void showMenu([TapUpDetails? details]) {
|
||||||
// This calculates the position of the flyout according to the parent navigator
|
// This calculates the position of the flyout according to the parent navigator
|
||||||
final targetContext = contextAttachKey.currentContext;
|
final targetContext = contextAttachKey.currentContext;
|
||||||
if (targetContext == null) return;
|
if (targetContext == null) return;
|
||||||
final box = targetContext.findRenderObject() as RenderBox;
|
final box = targetContext.findRenderObject() as RenderBox;
|
||||||
final position = box.localToGlobal(
|
Offset? position = box.localToGlobal(
|
||||||
details.localPosition,
|
details?.localPosition ?? box.size.center(Offset.zero),
|
||||||
ancestor: Navigator.of(context).context.findRenderObject(),
|
ancestor: Navigator.of(context).context.findRenderObject(),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -243,6 +265,12 @@ class _IllustWidgetState extends State<IllustWidget> {
|
|||||||
context.showToast(message: "Added");
|
context.showToast(message: "Added");
|
||||||
DownloadManager().addDownloadingTask(widget.illust);
|
DownloadManager().addDownloadingTask(widget.illust);
|
||||||
}),
|
}),
|
||||||
|
MenuFlyoutItem(
|
||||||
|
text: Text("Related Artworks".tl),
|
||||||
|
onPressed: () {
|
||||||
|
context.to(
|
||||||
|
() => RelatedIllustsPage(widget.illust.id.toString()));
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -320,150 +348,149 @@ class IllustHistoryWidget extends StatelessWidget {
|
|||||||
final width = constrains.maxWidth;
|
final width = constrains.maxWidth;
|
||||||
final height = illust.height * width / illust.width;
|
final height = illust.height * width / illust.width;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
Positioned.fill(
|
||||||
child: Container(
|
child: Container(
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
padding:
|
padding:
|
||||||
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8.0),
|
||||||
child: Card(
|
child: Card(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
context.to(() => IllustPageWithId(illust.id.toString()));
|
context.to(() => IllustPageWithId(illust.id.toString()));
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(4.0),
|
borderRadius: BorderRadius.circular(4.0),
|
||||||
child: AnimatedImage(
|
child: AnimatedImage(
|
||||||
image: CachedImageProvider(
|
image: CachedImageProvider(illust.imgPath),
|
||||||
illust.imgPath),
|
fit: BoxFit.cover,
|
||||||
fit: BoxFit.cover,
|
width: width - 16.0,
|
||||||
width: width - 16.0,
|
height: height - 16.0,
|
||||||
height: height - 16.0,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)),
|
),
|
||||||
if (illust.imageCount > 1)
|
)),
|
||||||
Positioned(
|
if (illust.imageCount > 1)
|
||||||
top: 12,
|
Positioned(
|
||||||
left: 12,
|
top: 12,
|
||||||
child: Container(
|
left: 12,
|
||||||
width: 28,
|
child: Container(
|
||||||
height: 20,
|
width: 28,
|
||||||
decoration: BoxDecoration(
|
height: 20,
|
||||||
color: FluentTheme.of(context)
|
decoration: BoxDecoration(
|
||||||
.micaBackgroundColor
|
color: FluentTheme.of(context)
|
||||||
.withOpacity(0.72),
|
.micaBackgroundColor
|
||||||
borderRadius: BorderRadius.circular(4),
|
.toOpacity(0.72),
|
||||||
border: Border.all(
|
borderRadius: BorderRadius.circular(4),
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
border: Border.all(
|
||||||
width: 0.6),
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
|
width: 0.6),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
"${illust.imageCount}P",
|
||||||
|
style: const TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"${illust.imageCount}P",
|
if (illust.isAi)
|
||||||
style: const TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
left: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isAi)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
left: 12,
|
color: ColorScheme.of(context)
|
||||||
child: Container(
|
.errorContainer
|
||||||
width: 28,
|
.toOpacity(0.8),
|
||||||
height: 20,
|
borderRadius: BorderRadius.circular(4),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
.errorContainer
|
width: 0.6),
|
||||||
.withOpacity(0.8),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"AI",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"AI",
|
if (illust.isGif)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
left: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isGif)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
left: 12,
|
color: ColorScheme.of(context)
|
||||||
child: Container(
|
.primaryContainer
|
||||||
width: 28,
|
.toOpacity(0.8),
|
||||||
height: 20,
|
borderRadius: BorderRadius.circular(4),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
.primaryContainer
|
width: 0.6),
|
||||||
.withOpacity(0.8),
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"GIF",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"GIF",
|
if (illust.isR18)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
right: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isR18)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
right: 12,
|
color: ColorScheme.of(context).errorContainer,
|
||||||
child: Container(
|
borderRadius: BorderRadius.circular(4),
|
||||||
width: 28,
|
border: Border.all(
|
||||||
height: 20,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
decoration: BoxDecoration(
|
width: 0.6),
|
||||||
color: ColorScheme.of(context).errorContainer,
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"R18",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"R18",
|
if (illust.isR18G)
|
||||||
style: TextStyle(fontSize: 12),
|
Positioned(
|
||||||
),
|
bottom: 12,
|
||||||
)),
|
right: 12,
|
||||||
),
|
child: Container(
|
||||||
if (illust.isR18G)
|
width: 28,
|
||||||
Positioned(
|
height: 20,
|
||||||
bottom: 12,
|
decoration: BoxDecoration(
|
||||||
right: 12,
|
color: ColorScheme.of(context).errorContainer,
|
||||||
child: Container(
|
borderRadius: BorderRadius.circular(4),
|
||||||
width: 28,
|
border: Border.all(
|
||||||
height: 20,
|
color: ColorScheme.of(context).outlineVariant,
|
||||||
decoration: BoxDecoration(
|
width: 0.6),
|
||||||
color: ColorScheme.of(context).errorContainer,
|
),
|
||||||
borderRadius: BorderRadius.circular(4),
|
child: const Center(
|
||||||
border: Border.all(
|
child: Text(
|
||||||
color: ColorScheme.of(context).outlineVariant,
|
"R18G",
|
||||||
width: 0.6),
|
style: TextStyle(fontSize: 12),
|
||||||
),
|
),
|
||||||
child: const Center(
|
)),
|
||||||
child: Text(
|
),
|
||||||
"R18G",
|
],
|
||||||
style: TextStyle(fontSize: 12),
|
),
|
||||||
),
|
);
|
||||||
)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ class KeyEventListenerState extends State<KeyEventListener> {
|
|||||||
focusNode: focusNode,
|
focusNode: focusNode,
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
onKeyEvent: (node, event) {
|
onKeyEvent: (node, event) {
|
||||||
if (event is! KeyUpEvent) return KeyEventResult.handled;
|
if (event is! KeyUpEvent) return KeyEventResult.ignored;
|
||||||
if (event.logicalKey == LogicalKeyboardKey.escape) {
|
if (event.logicalKey == LogicalKeyboardKey.escape) {
|
||||||
if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
|
if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
|
||||||
App.rootNavigatorKey.currentState?.pop();
|
App.rootNavigatorKey.currentState?.pop();
|
||||||
@@ -52,7 +52,7 @@ class KeyEventListenerState extends State<KeyEventListener> {
|
|||||||
for (var handler in _handlers) {
|
for (var handler in _handlers) {
|
||||||
handler(event.logicalKey);
|
handler(event.logicalKey);
|
||||||
}
|
}
|
||||||
return KeyEventResult.handled;
|
return KeyEventResult.ignored;
|
||||||
},
|
},
|
||||||
child: widget.child,
|
child: widget.child,
|
||||||
);
|
);
|
||||||
|
@@ -132,7 +132,9 @@ abstract class MultiPageLoadingState<T extends StatefulWidget, S extends Object>
|
|||||||
if(message.length > 20) {
|
if(message.length > 20) {
|
||||||
message = "${message.substring(0, 20)}...";
|
message = "${message.substring(0, 20)}...";
|
||||||
}
|
}
|
||||||
context.showToast(message: message);
|
if (mounted) {
|
||||||
|
context.showToast(message: message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -4,6 +4,7 @@ typedef MdIcons = md.Icons;
|
|||||||
typedef MdTheme = md.Theme;
|
typedef MdTheme = md.Theme;
|
||||||
typedef MdThemeData = md.ThemeData;
|
typedef MdThemeData = md.ThemeData;
|
||||||
typedef MdColorScheme = md.ColorScheme;
|
typedef MdColorScheme = md.ColorScheme;
|
||||||
|
typedef TextField = md.TextField;
|
||||||
|
|
||||||
class ColorScheme {
|
class ColorScheme {
|
||||||
static md.ColorScheme of(md.BuildContext context) {
|
static md.ColorScheme of(md.BuildContext context) {
|
||||||
|
@@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:fluent_ui/fluent_ui.dart';
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
import 'package:pixes/components/md.dart';
|
import 'package:pixes/components/md.dart';
|
||||||
|
import 'package:pixes/foundation/app.dart';
|
||||||
|
|
||||||
void showToast(BuildContext context, {required String message, IconData? icon}) {
|
void showToast(BuildContext context, {required String message, IconData? icon}) {
|
||||||
var newEntry = OverlayEntry(
|
var newEntry = OverlayEntry(
|
||||||
@@ -30,7 +31,7 @@ class ToastOverlay extends StatelessWidget {
|
|||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
child: PhysicalModel(
|
child: PhysicalModel(
|
||||||
color: ColorScheme.of(context).surface.withOpacity(1),
|
color: ColorScheme.of(context).surface.toOpacity(1),
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
elevation: 1,
|
elevation: 1,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@@ -330,7 +330,7 @@ class SideBarRoute<T> extends PopupRoute<T> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FluentTheme.of(context)
|
color: FluentTheme.of(context)
|
||||||
.micaBackgroundColor
|
.micaBackgroundColor
|
||||||
.withOpacity(0.98),
|
.toOpacity(0.98),
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(4),
|
topLeft: Radius.circular(4),
|
||||||
bottomLeft: Radius.circular(4))),
|
bottomLeft: Radius.circular(4))),
|
||||||
|
@@ -40,7 +40,7 @@ class SegmentedButton<T> extends StatelessWidget {
|
|||||||
onPressed: () => onPressed(e.key),
|
onPressed: () => onPressed(e.key),
|
||||||
builder: (context, states) {
|
builder: (context, states) {
|
||||||
var textColor = active ? null : ColorScheme.of(context).outline;
|
var textColor = active ? null : ColorScheme.of(context).outline;
|
||||||
var backgroundColor = active ? null : ButtonState.resolveWith((states) {
|
var backgroundColor = active ? null : WidgetStateProperty.resolveWith((states) {
|
||||||
return ButtonThemeData.buttonColor(context, states);
|
return ButtonThemeData.buttonColor(context, states);
|
||||||
}).resolve(states);
|
}).resolve(states);
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ export "state_controller.dart";
|
|||||||
export "navigation.dart";
|
export "navigation.dart";
|
||||||
|
|
||||||
class _App {
|
class _App {
|
||||||
final version = "1.0.7";
|
final version = "1.1.0";
|
||||||
|
|
||||||
bool get isAndroid => Platform.isAndroid;
|
bool get isAndroid => Platform.isAndroid;
|
||||||
bool get isIOS => Platform.isIOS;
|
bool get isIOS => Platform.isIOS;
|
||||||
|
@@ -32,11 +32,11 @@ class Log {
|
|||||||
static const String? logFile = null;
|
static const String? logFile = null;
|
||||||
|
|
||||||
static void printWarning(String text) {
|
static void printWarning(String text) {
|
||||||
print('\x1B[33m$text\x1B[0m');
|
debugPrint('\x1B[33m$text\x1B[0m');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void printError(String text) {
|
static void printError(String text) {
|
||||||
print('\x1B[31m$text\x1B[0m');
|
debugPrint('\x1B[31m$text\x1B[0m');
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addLog(LogLevel level, String title, String content) {
|
static void addLog(LogLevel level, String title, String content) {
|
||||||
@@ -44,15 +44,13 @@ class Log {
|
|||||||
content = "${content.substring(0, maxLogLength)}...";
|
content = "${content.substring(0, maxLogLength)}...";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kDebugMode) {
|
switch (level) {
|
||||||
switch (level) {
|
case LogLevel.error:
|
||||||
case LogLevel.error:
|
printError(content);
|
||||||
printError(content);
|
case LogLevel.warning:
|
||||||
case LogLevel.warning:
|
printWarning(content);
|
||||||
printWarning(content);
|
case LogLevel.info:
|
||||||
case LogLevel.info:
|
debugPrint(content);
|
||||||
print(content);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var newLog = LogItem(level, title, content);
|
var newLog = LogItem(level, title, content);
|
||||||
|
@@ -64,4 +64,10 @@ extension WidgetExtension on Widget{
|
|||||||
Widget fixHeight(double height){
|
Widget fixHeight(double height){
|
||||||
return SizedBox(height: height, child: this);
|
return SizedBox(height: height, child: this);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extension ColorExt on Color {
|
||||||
|
Color toOpacity(double opacity){
|
||||||
|
return withValues(alpha: opacity);
|
||||||
|
}
|
||||||
}
|
}
|
109
lib/main.dart
109
lib/main.dart
@@ -1,3 +1,4 @@
|
|||||||
|
import "dart:async";
|
||||||
import "dart:ui";
|
import "dart:ui";
|
||||||
|
|
||||||
import "package:dynamic_color/dynamic_color.dart";
|
import "package:dynamic_color/dynamic_color.dart";
|
||||||
@@ -18,45 +19,51 @@ import "package:pixes/pages/main_page.dart";
|
|||||||
import "package:pixes/utils/app_links.dart";
|
import "package:pixes/utils/app_links.dart";
|
||||||
import "package:pixes/utils/loop.dart";
|
import "package:pixes/utils/loop.dart";
|
||||||
import "package:pixes/utils/translation.dart";
|
import "package:pixes/utils/translation.dart";
|
||||||
|
import "package:pixes/utils/update.dart";
|
||||||
import "package:pixes/utils/window.dart";
|
import "package:pixes/utils/window.dart";
|
||||||
import "package:window_manager/window_manager.dart";
|
import "package:window_manager/window_manager.dart";
|
||||||
|
|
||||||
void main() async {
|
void main() {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
runZonedGuarded(() async {
|
||||||
FlutterError.onError = (details) {
|
Future.delayed(const Duration(seconds: 3), checkUpdate);
|
||||||
Log.error("Unhandled", "${details.exception}\n${details.stack}");
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
};
|
FlutterError.onError = (details) {
|
||||||
setSystemProxy();
|
Log.error("Unhandled", "${details.exception}\n${details.stack}");
|
||||||
await App.init();
|
};
|
||||||
await appdata.readData();
|
setSystemProxy();
|
||||||
await Translation.init();
|
await App.init();
|
||||||
HistoryManager().init();
|
await appdata.readData();
|
||||||
handleLinks();
|
await Translation.init();
|
||||||
if (App.isDesktop) {
|
HistoryManager().init();
|
||||||
await flutter_acrylic.Window.initialize();
|
handleLinks();
|
||||||
if (App.isWindows) {
|
if (App.isDesktop) {
|
||||||
await flutter_acrylic.Window.hideWindowControls();
|
await flutter_acrylic.Window.initialize();
|
||||||
}
|
if (App.isWindows) {
|
||||||
await WindowManager.instance.ensureInitialized();
|
await flutter_acrylic.Window.hideWindowControls();
|
||||||
windowManager.waitUntilReadyToShow().then((_) async {
|
|
||||||
await windowManager.setTitleBarStyle(
|
|
||||||
TitleBarStyle.hidden,
|
|
||||||
windowButtonVisibility: false,
|
|
||||||
);
|
|
||||||
if(App.isLinux) {
|
|
||||||
// https://github.com/leanflutter/window_manager/issues/460
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
await windowManager.setMinimumSize(const Size(500, 600));
|
await WindowManager.instance.ensureInitialized();
|
||||||
var placement = await WindowPlacement.loadFromFile();
|
windowManager.waitUntilReadyToShow().then((_) async {
|
||||||
await placement.applyToWindow();
|
await windowManager.setTitleBarStyle(
|
||||||
await windowManager.show();
|
TitleBarStyle.hidden,
|
||||||
Loop.register(WindowPlacement.loop);
|
windowButtonVisibility: false,
|
||||||
});
|
);
|
||||||
}
|
if (App.isLinux) {
|
||||||
Loop.start();
|
// https://github.com/leanflutter/window_manager/issues/460
|
||||||
Log.info("APP", "Application started");
|
return;
|
||||||
runApp(const MyApp());
|
}
|
||||||
|
await windowManager.setMinimumSize(const Size(500, 600));
|
||||||
|
var placement = await WindowPlacement.loadFromFile();
|
||||||
|
await placement.applyToWindow();
|
||||||
|
await windowManager.show();
|
||||||
|
Loop.register(WindowPlacement.loop);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Loop.start();
|
||||||
|
Log.info("APP", "Application started");
|
||||||
|
runApp(const MyApp());
|
||||||
|
}, (error, stack) {
|
||||||
|
Log.error("Unhandled Exception", "$error\n$stack");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyApp extends StatelessWidget {
|
class MyApp extends StatelessWidget {
|
||||||
@@ -65,7 +72,6 @@ class MyApp extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
var windowsFont = kDebugMode ? "微软雅黑" : "font";
|
|
||||||
return StateBuilder<SimpleController>(
|
return StateBuilder<SimpleController>(
|
||||||
init: SimpleController(),
|
init: SimpleController(),
|
||||||
tag: "MyApp",
|
tag: "MyApp",
|
||||||
@@ -98,7 +104,7 @@ class MyApp extends StatelessWidget {
|
|||||||
title: 'pixes',
|
title: 'pixes',
|
||||||
theme: FluentThemeData(
|
theme: FluentThemeData(
|
||||||
brightness: brightness,
|
brightness: brightness,
|
||||||
fontFamily: App.isWindows ? windowsFont : null,
|
fontFamily: App.isWindows ? "Microsoft YaHei UI" : null,
|
||||||
accentColor: AccentColor.swatch({
|
accentColor: AccentColor.swatch({
|
||||||
'darkest': darken(colorScheme.primary, 30),
|
'darkest': darken(colorScheme.primary, 30),
|
||||||
'darker': darken(colorScheme.primary, 20),
|
'darker': darken(colorScheme.primary, 20),
|
||||||
@@ -133,7 +139,7 @@ class MyApp extends StatelessWidget {
|
|||||||
colorScheme: colorScheme, useMaterial3: true),
|
colorScheme: colorScheme, useMaterial3: true),
|
||||||
child: DefaultTextStyle.merge(
|
child: DefaultTextStyle.merge(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontFamily: App.isWindows ? 'font' : null,
|
fontFamily: App.isWindows ? "Microsoft YaHei UI" : null,
|
||||||
),
|
),
|
||||||
child: OverlayWidget(child),
|
child: OverlayWidget(child),
|
||||||
),
|
),
|
||||||
@@ -151,7 +157,7 @@ class MyApp extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: widget,
|
child: widget,
|
||||||
);
|
);
|
||||||
} else if (App.windowsVersion == 10) {
|
} /* else if (App.windowsVersion == 10) {
|
||||||
flutter_acrylic.Window.setEffect(
|
flutter_acrylic.Window.setEffect(
|
||||||
effect: flutter_acrylic.WindowEffect.acrylic,
|
effect: flutter_acrylic.WindowEffect.acrylic,
|
||||||
dark: FluentTheme.of(context).brightness ==
|
dark: FluentTheme.of(context).brightness ==
|
||||||
@@ -164,7 +170,7 @@ class MyApp extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: widget,
|
child: widget,
|
||||||
);
|
);
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
return KeyEventListener(child: widget);
|
return KeyEventListener(child: widget);
|
||||||
@@ -176,21 +182,28 @@ class MyApp extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// from https://stackoverflow.com/a/60191441
|
int _floatToInt8(double x) {
|
||||||
|
return (x * 255.0).round() & 0xff;
|
||||||
|
}
|
||||||
|
|
||||||
Color darken(Color c, [int percent = 10]) {
|
Color darken(Color c, [int percent = 10]) {
|
||||||
assert(1 <= percent && percent <= 100);
|
assert(1 <= percent && percent <= 100);
|
||||||
var f = 1 - percent / 100;
|
var f = 1 - percent / 100;
|
||||||
return Color.fromARGB(c.alpha, (c.red * f).round(), (c.green * f).round(),
|
return Color.fromARGB(
|
||||||
(c.blue * f).round());
|
_floatToInt8(c.a),
|
||||||
|
_floatToInt8(c.r * f),
|
||||||
|
_floatToInt8(c.g * f),
|
||||||
|
_floatToInt8(c.b * f),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// from https://stackoverflow.com/a/60191441
|
|
||||||
Color lighten(Color c, [int percent = 10]) {
|
Color lighten(Color c, [int percent = 10]) {
|
||||||
assert(1 <= percent && percent <= 100);
|
assert(1 <= percent && percent <= 100);
|
||||||
var p = percent / 100;
|
var p = percent / 100;
|
||||||
return Color.fromARGB(
|
return Color.fromARGB(
|
||||||
c.alpha,
|
_floatToInt8(c.a),
|
||||||
c.red + ((255 - c.red) * p).round(),
|
_floatToInt8(c.r + (1 - c.r) * p),
|
||||||
c.green + ((255 - c.green) * p).round(),
|
_floatToInt8(c.g + (1 - c.g) * p),
|
||||||
c.blue + ((255 - c.blue) * p).round());
|
_floatToInt8(c.b + (1 - c.b) * p),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
@@ -109,12 +110,53 @@ class AppDio extends DioForNative {
|
|||||||
CancelToken? cancelToken,
|
CancelToken? cancelToken,
|
||||||
Options? options,
|
Options? options,
|
||||||
ProgressCallback? onSendProgress,
|
ProgressCallback? onSendProgress,
|
||||||
ProgressCallback? onReceiveProgress}) {
|
ProgressCallback? onReceiveProgress}) async{
|
||||||
if (!isInitialized) {
|
if (!isInitialized) {
|
||||||
isInitialized = true;
|
isInitialized = true;
|
||||||
interceptors.add(MyLogInterceptor());
|
interceptors.add(MyLogInterceptor());
|
||||||
}
|
}
|
||||||
return super.request(path,
|
if(T == Map<String, dynamic>) {
|
||||||
|
var res = await super.request<String>(path,
|
||||||
|
data: data,
|
||||||
|
queryParameters: queryParameters,
|
||||||
|
cancelToken: cancelToken,
|
||||||
|
options: options,
|
||||||
|
onSendProgress: onSendProgress,
|
||||||
|
onReceiveProgress: onReceiveProgress);
|
||||||
|
if(res.data == null) {
|
||||||
|
return Response(
|
||||||
|
data: null,
|
||||||
|
requestOptions: res.requestOptions,
|
||||||
|
statusCode: res.statusCode,
|
||||||
|
statusMessage: res.statusMessage,
|
||||||
|
isRedirect: res.isRedirect,
|
||||||
|
redirects: res.redirects,
|
||||||
|
extra: res.extra,
|
||||||
|
headers: res.headers
|
||||||
|
);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
var json = jsonDecode(res.data!);
|
||||||
|
return Response(
|
||||||
|
data: json,
|
||||||
|
requestOptions: res.requestOptions,
|
||||||
|
statusCode: res.statusCode,
|
||||||
|
statusMessage: res.statusMessage,
|
||||||
|
isRedirect: res.isRedirect,
|
||||||
|
redirects: res.redirects,
|
||||||
|
extra: res.extra,
|
||||||
|
headers: res.headers
|
||||||
|
);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
var data = res.data!;
|
||||||
|
if(data.length > 50) {
|
||||||
|
data = "${data.substring(0, 50)}...";
|
||||||
|
}
|
||||||
|
throw "Failed to decode response: $e\n$data";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return super.request<T>(path,
|
||||||
data: data,
|
data: data,
|
||||||
queryParameters: queryParameters,
|
queryParameters: queryParameters,
|
||||||
cancelToken: cancelToken,
|
cancelToken: cancelToken,
|
||||||
|
@@ -324,7 +324,7 @@ class DownloadManager {
|
|||||||
where illust_id = ?;
|
where illust_id = ?;
|
||||||
''', [illust.illustId]);
|
''', [illust.illustId]);
|
||||||
for(var image in images) {
|
for(var image in images) {
|
||||||
File(image["path"] as String).deleteIfExists();
|
File(image["path"] as String).deleteIgnoreError();
|
||||||
}
|
}
|
||||||
_db.execute('''
|
_db.execute('''
|
||||||
delete from images
|
delete from images
|
||||||
|
@@ -387,9 +387,9 @@ class Network {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Res<List<Illust>>> getUserIllusts(String uid) async {
|
Future<Res<List<Illust>>> getUserIllusts(String uid, String? type) async {
|
||||||
var res = await apiGet(
|
var res = await apiGet(
|
||||||
"/v1/user/illusts?filter=for_android&user_id=$uid&type=illust");
|
"/v1/user/illusts?filter=for_android&user_id=$uid${type != null ? "&type=$type" : ""}");
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
return Res(
|
return Res(
|
||||||
(res.data["illusts"] as List).map((e) => Illust.fromJson(e)).toList(),
|
(res.data["illusts"] as List).map((e) => Illust.fromJson(e)).toList(),
|
||||||
@@ -574,7 +574,7 @@ class Network {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Res<bool>> sendHistory(List<int> ids) async{
|
Future<Res<bool>> sendHistory(List<int> ids) async {
|
||||||
var res = await apiPost("/v2/user/browsing-history/illust/add",
|
var res = await apiPost("/v2/user/browsing-history/illust/add",
|
||||||
data: {"illust_ids": ids});
|
data: {"illust_ids": ids});
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
75
lib/network/translator.dart
Normal file
75
lib/network/translator.dart
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
import 'package:pixes/network/app_dio.dart';
|
||||||
|
|
||||||
|
abstract class Translator {
|
||||||
|
static Translator? _instance;
|
||||||
|
|
||||||
|
static Translator get instance {
|
||||||
|
if (_instance == null) {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void init() {
|
||||||
|
_instance = GoogleTranslator();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Translates the given [text] to the given [to] language.
|
||||||
|
Future<String> translate(String text, String to);
|
||||||
|
}
|
||||||
|
|
||||||
|
class GoogleTranslator implements Translator {
|
||||||
|
final Dio _dio = AppDio();
|
||||||
|
|
||||||
|
String get url => 'https://translate.google.com/translate_a/single';
|
||||||
|
|
||||||
|
Map<String, dynamic> buildBody(String text, String to) {
|
||||||
|
return {
|
||||||
|
'q': text,
|
||||||
|
'client': 'at',
|
||||||
|
'sl': 'auto',
|
||||||
|
'tl': to,
|
||||||
|
'dt': 't',
|
||||||
|
'ie': 'UTF-8',
|
||||||
|
'oe': 'UTF-8',
|
||||||
|
'dj': '1',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> translatePart(String part, String to) async {
|
||||||
|
final response = await _dio.post(
|
||||||
|
url,
|
||||||
|
data: buildBody(part, to),
|
||||||
|
options: Options(
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
var buffer = StringBuffer();
|
||||||
|
for(var e in response.data['sentences']) {
|
||||||
|
buffer.write(e['trans']);
|
||||||
|
}
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<String> translate(String text, String to) async {
|
||||||
|
final lines = text.split('\n');
|
||||||
|
var buffer = StringBuffer();
|
||||||
|
var result = '';
|
||||||
|
for(int i=0; i<lines.length; i++) {
|
||||||
|
final line = lines[i];
|
||||||
|
if (buffer.length + line.length > 5000) {
|
||||||
|
result += await translatePart(buffer.toString(), to);
|
||||||
|
buffer.clear();
|
||||||
|
}
|
||||||
|
buffer.write(line);
|
||||||
|
buffer.write('\n');
|
||||||
|
}
|
||||||
|
if (buffer.isNotEmpty) {
|
||||||
|
result += await translatePart(buffer.toString(), to);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
@@ -143,15 +143,15 @@ class _CommentsPageState extends MultiPageLoadingState<CommentsPage, Comment> {
|
|||||||
return Card(
|
return Card(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
FluentTheme.of(context).micaBackgroundColor.withOpacity(0.96),
|
FluentTheme.of(context).micaBackgroundColor.toOpacity(0.96),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 52,
|
height: 52,
|
||||||
child: TextBox(
|
child: TextBox(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||||
placeholder: "Comment".tl,
|
placeholder: "Comment".tl,
|
||||||
foregroundDecoration: BoxDecoration(
|
foregroundDecoration: WidgetStatePropertyAll(BoxDecoration(
|
||||||
border: Border.all(color: Colors.transparent),
|
border: Border.all(color: Colors.transparent),
|
||||||
),
|
)),
|
||||||
onSubmitted: (s) {
|
onSubmitted: (s) {
|
||||||
showToast(context, message: "Sending".tl);
|
showToast(context, message: "Sending".tl);
|
||||||
if (isCommenting) return;
|
if (isCommenting) return;
|
||||||
@@ -161,10 +161,12 @@ class _CommentsPageState extends MultiPageLoadingState<CommentsPage, Comment> {
|
|||||||
if (widget.isNovel) {
|
if (widget.isNovel) {
|
||||||
Network().commentNovel(widget.id, s).then((value) {
|
Network().commentNovel(widget.id, s).then((value) {
|
||||||
if (value.error) {
|
if (value.error) {
|
||||||
context.showToast(message: "Network Error");
|
if (context.mounted) {
|
||||||
setState(() {
|
context.showToast(message: "Network Error");
|
||||||
isCommenting = false;
|
setState(() {
|
||||||
});
|
isCommenting = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
isCommenting = false;
|
isCommenting = false;
|
||||||
nextUrl = null;
|
nextUrl = null;
|
||||||
@@ -174,10 +176,12 @@ class _CommentsPageState extends MultiPageLoadingState<CommentsPage, Comment> {
|
|||||||
} else {
|
} else {
|
||||||
Network().comment(widget.id, s).then((value) {
|
Network().comment(widget.id, s).then((value) {
|
||||||
if (value.error) {
|
if (value.error) {
|
||||||
context.showToast(message: "Network Error");
|
if(context.mounted) {
|
||||||
setState(() {
|
context.showToast(message: "Network Error");
|
||||||
isCommenting = false;
|
setState(() {
|
||||||
});
|
isCommenting = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
isCommenting = false;
|
isCommenting = false;
|
||||||
nextUrl = null;
|
nextUrl = null;
|
||||||
|
@@ -4,7 +4,6 @@ import 'package:fluent_ui/fluent_ui.dart';
|
|||||||
import 'package:flutter/gestures.dart';
|
import 'package:flutter/gestures.dart';
|
||||||
import 'package:flutter/material.dart' show Icons;
|
import 'package:flutter/material.dart' show Icons;
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
|
||||||
import 'package:pixes/appdata.dart';
|
import 'package:pixes/appdata.dart';
|
||||||
import 'package:pixes/components/animated_image.dart';
|
import 'package:pixes/components/animated_image.dart';
|
||||||
import 'package:pixes/components/keyboard.dart';
|
import 'package:pixes/components/keyboard.dart';
|
||||||
@@ -20,6 +19,7 @@ import 'package:pixes/network/download.dart';
|
|||||||
import 'package:pixes/network/network.dart';
|
import 'package:pixes/network/network.dart';
|
||||||
import 'package:pixes/pages/comments_page.dart';
|
import 'package:pixes/pages/comments_page.dart';
|
||||||
import 'package:pixes/pages/image_page.dart';
|
import 'package:pixes/pages/image_page.dart';
|
||||||
|
import 'package:pixes/pages/related_page.dart';
|
||||||
import 'package:pixes/pages/search_page.dart';
|
import 'package:pixes/pages/search_page.dart';
|
||||||
import 'package:pixes/pages/user_info_page.dart';
|
import 'package:pixes/pages/user_info_page.dart';
|
||||||
import 'package:pixes/utils/block.dart';
|
import 'package:pixes/utils/block.dart';
|
||||||
@@ -620,7 +620,7 @@ class _BottomBarState extends State<_BottomBar> with TickerProviderStateMixin {
|
|||||||
borderRadius:
|
borderRadius:
|
||||||
const BorderRadius.vertical(top: Radius.circular(8)),
|
const BorderRadius.vertical(top: Radius.circular(8)),
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
FluentTheme.of(context).micaBackgroundColor.withOpacity(0.96),
|
FluentTheme.of(context).micaBackgroundColor.toOpacity(0.96),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -1140,7 +1140,7 @@ class _BottomBarState extends State<_BottomBar> with TickerProviderStateMixin {
|
|||||||
).fixWidth(96),
|
).fixWidth(96),
|
||||||
Button(
|
Button(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
context.to(() => _RelatedIllustsPage(widget.illust.id.toString()));
|
context.to(() => RelatedIllustsPage(widget.illust.id.toString()));
|
||||||
},
|
},
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 28,
|
height: 28,
|
||||||
@@ -1219,7 +1219,7 @@ class __BlockingPageState extends State<_BlockingPage> {
|
|||||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
|
||||||
borderColor: blockedTags.contains(index)
|
borderColor: blockedTags.contains(index)
|
||||||
? ColorScheme.of(context).outlineVariant
|
? ColorScheme.of(context).outlineVariant
|
||||||
: ColorScheme.of(context).outlineVariant.withOpacity(0.2),
|
: ColorScheme.of(context).outlineVariant.toOpacity(0.2),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
title: Text(text),
|
title: Text(text),
|
||||||
@@ -1357,64 +1357,3 @@ class _IllustPageWithIdState extends LoadingState<IllustPageWithId, Illust> {
|
|||||||
return Network().getIllustByID(widget.id);
|
return Network().getIllustByID(widget.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RelatedIllustsPage extends StatefulWidget {
|
|
||||||
const _RelatedIllustsPage(this.id);
|
|
||||||
|
|
||||||
final String id;
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<_RelatedIllustsPage> createState() => _RelatedIllustsPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _RelatedIllustsPageState
|
|
||||||
extends MultiPageLoadingState<_RelatedIllustsPage, Illust> {
|
|
||||||
@override
|
|
||||||
Widget? buildFrame(BuildContext context, Widget child) {
|
|
||||||
return Column(
|
|
||||||
children: [
|
|
||||||
TitleBar(title: "Related artworks".tl),
|
|
||||||
Expanded(
|
|
||||||
child: child,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget buildContent(BuildContext context, final List<Illust> data) {
|
|
||||||
return LayoutBuilder(builder: (context, constrains) {
|
|
||||||
return MasonryGridView.builder(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8) +
|
|
||||||
EdgeInsets.only(bottom: context.padding.bottom),
|
|
||||||
gridDelegate: const SliverSimpleGridDelegateWithMaxCrossAxisExtent(
|
|
||||||
maxCrossAxisExtent: 240,
|
|
||||||
),
|
|
||||||
itemCount: data.length,
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
if (index == data.length - 1) {
|
|
||||||
nextPage();
|
|
||||||
}
|
|
||||||
return IllustWidget(data[index]);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
String? nextUrl;
|
|
||||||
|
|
||||||
@override
|
|
||||||
Future<Res<List<Illust>>> loadData(page) async {
|
|
||||||
if (nextUrl == "end") {
|
|
||||||
return Res.error("No more data");
|
|
||||||
}
|
|
||||||
var res = nextUrl == null
|
|
||||||
? await Network().relatedIllusts(widget.id)
|
|
||||||
: await Network().getIllustsWithNextUrl(nextUrl!);
|
|
||||||
if (!res.error) {
|
|
||||||
nextUrl = res.subData;
|
|
||||||
nextUrl ??= "end";
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@@ -92,7 +92,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
void showMenu() {
|
void showMenu() {
|
||||||
menuController.showFlyout(
|
menuController.showFlyout(
|
||||||
barrierColor: Colors.transparent,
|
barrierColor: Colors.transparent,
|
||||||
position: Offset(context.size!.width, 0),
|
position: App.isMobile ? Offset(context.size!.width, 0) : null,
|
||||||
builder: (context) => MenuFlyout(
|
builder: (context) => MenuFlyout(
|
||||||
items: [
|
items: [
|
||||||
MenuFlyoutItem(
|
MenuFlyoutItem(
|
||||||
@@ -100,7 +100,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var file = await getFile();
|
var file = await getFile();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
var fileName = file.path.split('/').last;
|
var fileName = widget.urls[currentPage].split('/').last;
|
||||||
if (!fileName.contains('.')) {
|
if (!fileName.contains('.')) {
|
||||||
fileName += getExtensionName();
|
fileName += getExtensionName();
|
||||||
}
|
}
|
||||||
@@ -113,13 +113,16 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var file = await getFile();
|
var file = await getFile();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
var fileName = file.path.split('/').last;
|
var fileName =
|
||||||
|
widget.urls[currentPage].split('/').last;
|
||||||
if (!fileName.contains('.')) {
|
if (!fileName.contains('.')) {
|
||||||
fileName += getExtensionName();
|
fileName += getExtensionName();
|
||||||
}
|
}
|
||||||
await ImageGallerySaver.saveFile(file.path,
|
await ImageGallerySaver.saveImage(
|
||||||
|
await file.readAsBytes(),
|
||||||
|
quality: 100,
|
||||||
name: fileName);
|
name: fileName);
|
||||||
if (mounted) {
|
if (context.mounted) {
|
||||||
showToast(context, message: "Saved".tl);
|
showToast(context, message: "Saved".tl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -130,7 +133,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
var file = await getFile();
|
var file = await getFile();
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
var ext = getExtensionName();
|
var ext = getExtensionName();
|
||||||
var fileName = file.path.split('/').last;
|
var fileName = widget.urls[currentPage].split('/').last;
|
||||||
if (!fileName.contains('.')) {
|
if (!fileName.contains('.')) {
|
||||||
fileName += ext;
|
fileName += ext;
|
||||||
}
|
}
|
||||||
@@ -185,6 +188,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
|
|||||||
var image = widget.urls[index];
|
var image = widget.urls[index];
|
||||||
|
|
||||||
return PhotoViewGalleryPageOptions(
|
return PhotoViewGalleryPageOptions(
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
imageProvider: getImageProvider(image),
|
imageProvider: getImageProvider(image),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
@@ -87,7 +87,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 8,
|
width: 8,
|
||||||
),
|
),
|
||||||
Text("I have read and agree to the Terms of Use".tl)
|
Expanded(
|
||||||
|
child: Text("I understand pixes is a free unofficial application.".tl),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
@@ -34,7 +34,7 @@ class _LogsPageState extends State<LogsPage> {
|
|||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ColorScheme.of(context).surfaceVariant,
|
color: ColorScheme.of(context).surfaceContainerHighest,
|
||||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
@@ -2,6 +2,7 @@ import "dart:async";
|
|||||||
|
|
||||||
import "package:fluent_ui/fluent_ui.dart";
|
import "package:fluent_ui/fluent_ui.dart";
|
||||||
import "package:flutter/foundation.dart";
|
import "package:flutter/foundation.dart";
|
||||||
|
import "package:flutter/services.dart";
|
||||||
import "package:pixes/appdata.dart";
|
import "package:pixes/appdata.dart";
|
||||||
import "package:pixes/components/md.dart";
|
import "package:pixes/components/md.dart";
|
||||||
import "package:pixes/foundation/app.dart";
|
import "package:pixes/foundation/app.dart";
|
||||||
@@ -64,26 +65,43 @@ class MainPage extends StatefulWidget {
|
|||||||
State<MainPage> createState() => _MainPageState();
|
State<MainPage> createState() => _MainPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MainPageState extends State<MainPage> with WindowListener {
|
class _MainPageState extends State<MainPage>
|
||||||
|
with WindowListener
|
||||||
|
implements PopEntry {
|
||||||
final navigatorKey = GlobalKey<NavigatorState>();
|
final navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
int index = 4;
|
int index = 4;
|
||||||
|
|
||||||
int windowButtonKey = 0;
|
int windowButtonKey = 0;
|
||||||
|
|
||||||
|
ModalRoute<dynamic>? _route;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
StateController.put<TitleBarController>(TitleBarController());
|
StateController.put<TitleBarController>(TitleBarController());
|
||||||
windowManager.addListener(this);
|
windowManager.addListener(this);
|
||||||
listenMouseSideButtonToBack(navigatorKey);
|
listenMouseSideButtonToBack(navigatorKey);
|
||||||
App.mainNavigatorKey = navigatorKey;
|
App.mainNavigatorKey = navigatorKey;
|
||||||
|
index = appdata.settings["initialPage"] ?? 4;
|
||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
super.didChangeDependencies();
|
||||||
|
final ModalRoute<dynamic>? nextRoute = ModalRoute.of(context);
|
||||||
|
if (nextRoute != _route) {
|
||||||
|
_route?.unregisterPopEntry(this);
|
||||||
|
_route = nextRoute;
|
||||||
|
_route?.registerPopEntry(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
StateController.remove<TitleBarController>();
|
StateController.remove<TitleBarController>();
|
||||||
windowManager.removeListener(this);
|
windowManager.removeListener(this);
|
||||||
|
ModalRoute.of(context)!.unregisterPopEntry(this);
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +130,7 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return DefaultSelectionStyle.merge(
|
return DefaultSelectionStyle.merge(
|
||||||
selectionColor: FluentTheme.of(context).selectionColor.withOpacity(0.4),
|
selectionColor: FluentTheme.of(context).selectionColor.toOpacity(0.4),
|
||||||
child: NavigationView(
|
child: NavigationView(
|
||||||
appBar: buildAppBar(context, navigatorKey),
|
appBar: buildAppBar(context, navigatorKey),
|
||||||
pane: NavigationPane(
|
pane: NavigationPane(
|
||||||
@@ -151,7 +169,7 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
),
|
),
|
||||||
PaneItemSeparator(),
|
PaneItemSeparator(),
|
||||||
PaneItemHeader(
|
PaneItemHeader(
|
||||||
header: Text('${"Artwork".tl}/${"Manga".tl}')
|
header: Text('${"Illustrations".tl}/${"Manga".tl}')
|
||||||
.paddingBottom(4)
|
.paddingBottom(4)
|
||||||
.paddingLeft(8)),
|
.paddingLeft(8)),
|
||||||
PaneItem(
|
PaneItem(
|
||||||
@@ -209,18 +227,17 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
paneBodyBuilder: (pane, child) => NavigatorPopHandler(
|
paneBodyBuilder: (pane, child) => MediaQuery.removePadding(
|
||||||
key: const Key("navigator"),
|
|
||||||
onPop: () => navigatorKey.currentState?.pop(),
|
|
||||||
child: MediaQuery.removePadding(
|
|
||||||
context: context,
|
context: context,
|
||||||
removeTop: true,
|
removeTop: true,
|
||||||
child: Navigator(
|
child: Navigator(
|
||||||
key: navigatorKey,
|
key: navigatorKey,
|
||||||
onGenerateRoute: (settings) => AppPageRoute(
|
onGenerateRoute: (settings) => AppPageRoute(
|
||||||
builder: (context) => const RecommendationPage()),
|
builder: (context) =>
|
||||||
|
pageBuilders.elementAtOrNull(index)!(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
))),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -297,7 +314,26 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
).paddingTop(4).paddingLeft(4),
|
).paddingTop(4).paddingLeft(4),
|
||||||
if (App.isDesktop) const SizedBox(width: 128),
|
if (App.isDesktop)
|
||||||
|
const SizedBox(width: 128)
|
||||||
|
else
|
||||||
|
Tooltip(
|
||||||
|
message: "Search".tl,
|
||||||
|
child: IconButton(
|
||||||
|
icon: const Icon(
|
||||||
|
MdIcons.search,
|
||||||
|
size: 18,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
if (index == 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
index = 1;
|
||||||
|
});
|
||||||
|
navigate(1);
|
||||||
|
},
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -315,6 +351,25 @@ class _MainPageState extends State<MainPage> with WindowListener {
|
|||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final popValue = ValueNotifier(false);
|
||||||
|
|
||||||
|
@override
|
||||||
|
ValueListenable<bool> get canPopNotifier => popValue;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onPopInvokedWithResult(bool didPop, result) {
|
||||||
|
if (App.rootNavigatorKey.currentState?.canPop() ?? false) {
|
||||||
|
App.rootNavigatorKey.currentState?.pop();
|
||||||
|
} else if (App.mainNavigatorKey?.currentState?.canPop() ?? false) {
|
||||||
|
App.mainNavigatorKey?.currentState?.pop();
|
||||||
|
} else {
|
||||||
|
SystemNavigator.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onPopInvoked(bool didPop) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class _BackButton extends StatefulWidget {
|
class _BackButton extends StatefulWidget {
|
||||||
@@ -365,7 +420,7 @@ class _BackButtonState extends State<_BackButton> {
|
|||||||
|
|
||||||
return NavigationPaneTheme(
|
return NavigationPaneTheme(
|
||||||
data: NavigationPaneTheme.of(context).merge(NavigationPaneThemeData(
|
data: NavigationPaneTheme.of(context).merge(NavigationPaneThemeData(
|
||||||
unselectedIconColor: ButtonState.resolveWith((states) {
|
unselectedIconColor: WidgetStateProperty.resolveWith((states) {
|
||||||
if (states.isDisabled) {
|
if (states.isDisabled) {
|
||||||
return ButtonThemeData.buttonColor(context, states);
|
return ButtonThemeData.buttonColor(context, states);
|
||||||
}
|
}
|
||||||
@@ -618,16 +673,16 @@ class UserPane extends PaneItem {
|
|||||||
final tileColor = this.tileColor ??
|
final tileColor = this.tileColor ??
|
||||||
theme.tileColor ??
|
theme.tileColor ??
|
||||||
kDefaultPaneItemColor(context, mode == PaneDisplayMode.top);
|
kDefaultPaneItemColor(context, mode == PaneDisplayMode.top);
|
||||||
final newStates = states.toSet()..remove(ButtonStates.disabled);
|
final newStates = states.toSet()..remove(WidgetState.disabled);
|
||||||
if (selected && selectedTileColor != null) {
|
if (selected && selectedTileColor != null) {
|
||||||
return selectedTileColor!.resolve(newStates);
|
return selectedTileColor!.resolve(newStates);
|
||||||
}
|
}
|
||||||
return tileColor.resolve(
|
return tileColor.resolve(
|
||||||
selected
|
selected
|
||||||
? {
|
? {
|
||||||
states.isHovering
|
states.isHovered
|
||||||
? ButtonStates.pressing
|
? WidgetState.pressed
|
||||||
: ButtonStates.hovering,
|
: WidgetState.hovered,
|
||||||
}
|
}
|
||||||
: newStates,
|
: newStates,
|
||||||
);
|
);
|
||||||
@@ -655,13 +710,16 @@ class UserPane extends PaneItem {
|
|||||||
/// Close
|
/// Close
|
||||||
class CloseIcon extends StatelessWidget {
|
class CloseIcon extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
const CloseIcon({super.key, required this.color});
|
const CloseIcon({super.key, required this.color});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _AlignedPaint(_ClosePainter(color));
|
Widget build(BuildContext context) => _AlignedPaint(_ClosePainter(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _ClosePainter extends _IconPainter {
|
class _ClosePainter extends _IconPainter {
|
||||||
_ClosePainter(super.color);
|
_ClosePainter(super.color);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
Paint p = getPaint(color, true);
|
Paint p = getPaint(color, true);
|
||||||
@@ -673,13 +731,16 @@ class _ClosePainter extends _IconPainter {
|
|||||||
/// Maximize
|
/// Maximize
|
||||||
class MaximizeIcon extends StatelessWidget {
|
class MaximizeIcon extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
const MaximizeIcon({super.key, required this.color});
|
const MaximizeIcon({super.key, required this.color});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _AlignedPaint(_MaximizePainter(color));
|
Widget build(BuildContext context) => _AlignedPaint(_MaximizePainter(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MaximizePainter extends _IconPainter {
|
class _MaximizePainter extends _IconPainter {
|
||||||
_MaximizePainter(super.color);
|
_MaximizePainter(super.color);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
Paint p = getPaint(color);
|
Paint p = getPaint(color);
|
||||||
@@ -690,16 +751,19 @@ class _MaximizePainter extends _IconPainter {
|
|||||||
/// Restore
|
/// Restore
|
||||||
class RestoreIcon extends StatelessWidget {
|
class RestoreIcon extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
const RestoreIcon({
|
const RestoreIcon({
|
||||||
super.key,
|
super.key,
|
||||||
required this.color,
|
required this.color,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _AlignedPaint(_RestorePainter(color));
|
Widget build(BuildContext context) => _AlignedPaint(_RestorePainter(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _RestorePainter extends _IconPainter {
|
class _RestorePainter extends _IconPainter {
|
||||||
_RestorePainter(super.color);
|
_RestorePainter(super.color);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
Paint p = getPaint(color);
|
Paint p = getPaint(color);
|
||||||
@@ -716,13 +780,16 @@ class _RestorePainter extends _IconPainter {
|
|||||||
/// Minimize
|
/// Minimize
|
||||||
class MinimizeIcon extends StatelessWidget {
|
class MinimizeIcon extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
const MinimizeIcon({super.key, required this.color});
|
const MinimizeIcon({super.key, required this.color});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => _AlignedPaint(_MinimizePainter(color));
|
Widget build(BuildContext context) => _AlignedPaint(_MinimizePainter(color));
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MinimizePainter extends _IconPainter {
|
class _MinimizePainter extends _IconPainter {
|
||||||
_MinimizePainter(super.color);
|
_MinimizePainter(super.color);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void paint(Canvas canvas, Size size) {
|
void paint(Canvas canvas, Size size) {
|
||||||
Paint p = getPaint(color);
|
Paint p = getPaint(color);
|
||||||
@@ -734,6 +801,7 @@ class _MinimizePainter extends _IconPainter {
|
|||||||
/// Helpers
|
/// Helpers
|
||||||
abstract class _IconPainter extends CustomPainter {
|
abstract class _IconPainter extends CustomPainter {
|
||||||
_IconPainter(this.color);
|
_IconPainter(this.color);
|
||||||
|
|
||||||
final Color color;
|
final Color color;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -742,6 +810,7 @@ abstract class _IconPainter extends CustomPainter {
|
|||||||
|
|
||||||
class _AlignedPaint extends StatelessWidget {
|
class _AlignedPaint extends StatelessWidget {
|
||||||
const _AlignedPaint(this.painter);
|
const _AlignedPaint(this.painter);
|
||||||
|
|
||||||
final CustomPainter painter;
|
final CustomPainter painter;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@@ -214,7 +214,7 @@ class _NovelPageState extends State<NovelPage> {
|
|||||||
constraints: const BoxConstraints(maxWidth: 560),
|
constraints: const BoxConstraints(maxWidth: 560),
|
||||||
child: Card(
|
child: Card(
|
||||||
margin: const EdgeInsets.only(left: 2, right: 2, bottom: 12),
|
margin: const EdgeInsets.only(left: 2, right: 2, bottom: 12),
|
||||||
borderColor: ColorScheme.of(context).outlineVariant.withOpacity(0.52),
|
borderColor: ColorScheme.of(context).outlineVariant.toOpacity(0.52),
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
behavior: HitTestBehavior.opaque,
|
behavior: HitTestBehavior.opaque,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
@@ -555,7 +555,7 @@ class _NovelSeriesWidgetState
|
|||||||
color: FluentTheme.of(context).cardColor,
|
color: FluentTheme.of(context).cardColor,
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context).outlineVariant.withOpacity(0.6),
|
color: ColorScheme.of(context).outlineVariant.toOpacity(0.6),
|
||||||
width: 0.5,
|
width: 0.5,
|
||||||
)),
|
)),
|
||||||
sliver: SliverMainAxisGroup(slivers: [
|
sliver: SliverMainAxisGroup(slivers: [
|
||||||
@@ -646,7 +646,7 @@ class _NovelPageWithIdState extends LoadingState<NovelPageWithId, Novel> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _RelatedNovelsPage extends StatefulWidget {
|
class _RelatedNovelsPage extends StatefulWidget {
|
||||||
const _RelatedNovelsPage(this.id, {super.key});
|
const _RelatedNovelsPage(this.id);
|
||||||
|
|
||||||
final String id;
|
final String id;
|
||||||
|
|
||||||
|
@@ -7,7 +7,9 @@ import 'package:pixes/components/page_route.dart';
|
|||||||
import 'package:pixes/components/title_bar.dart';
|
import 'package:pixes/components/title_bar.dart';
|
||||||
import 'package:pixes/foundation/app.dart';
|
import 'package:pixes/foundation/app.dart';
|
||||||
import 'package:pixes/foundation/image_provider.dart';
|
import 'package:pixes/foundation/image_provider.dart';
|
||||||
|
import 'package:pixes/foundation/log.dart';
|
||||||
import 'package:pixes/network/network.dart';
|
import 'package:pixes/network/network.dart';
|
||||||
|
import 'package:pixes/network/translator.dart';
|
||||||
import 'package:pixes/pages/image_page.dart';
|
import 'package:pixes/pages/image_page.dart';
|
||||||
import 'package:pixes/pages/main_page.dart';
|
import 'package:pixes/pages/main_page.dart';
|
||||||
import 'package:pixes/utils/ext.dart';
|
import 'package:pixes/utils/ext.dart';
|
||||||
@@ -27,15 +29,36 @@ class _NovelReadingPageState extends LoadingState<NovelReadingPage, String> {
|
|||||||
|
|
||||||
bool isShowingSettings = false;
|
bool isShowingSettings = false;
|
||||||
|
|
||||||
|
String? translatedContent;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
action = TitleBarAction(MdIcons.tune, "Settings".tl, () {
|
action = TitleBarAction(MdIcons.tune, "Settings".tl, () {
|
||||||
if (!isShowingSettings) {
|
if (!isShowingSettings) {
|
||||||
_NovelReadingSettings.show(context, () {
|
_NovelReadingSettings.show(
|
||||||
setState(() {});
|
context,
|
||||||
}).then((value) {
|
() {
|
||||||
isShowingSettings = false;
|
setState(() {});
|
||||||
});
|
},
|
||||||
|
TranslationController(
|
||||||
|
content: data!,
|
||||||
|
isTranslated: translatedContent != null,
|
||||||
|
onTranslated: (s) {
|
||||||
|
setState(() {
|
||||||
|
translatedContent = s;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
revert: () {
|
||||||
|
setState(() {
|
||||||
|
translatedContent = null;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
).then(
|
||||||
|
(value) {
|
||||||
|
isShowingSettings = false;
|
||||||
|
},
|
||||||
|
);
|
||||||
isShowingSettings = true;
|
isShowingSettings = true;
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
@@ -92,7 +115,7 @@ class _NovelReadingPageState extends LoadingState<NovelReadingPage, String> {
|
|||||||
);
|
);
|
||||||
yield const SizedBox(height: 12.0);
|
yield const SizedBox(height: 12.0);
|
||||||
|
|
||||||
var novelContent = data!.split('\n');
|
var novelContent = (translatedContent ?? data!).split('\n');
|
||||||
for (var content in novelContent) {
|
for (var content in novelContent) {
|
||||||
if (content.isEmpty) continue;
|
if (content.isEmpty) continue;
|
||||||
if (content.startsWith('[uploadedimage:')) {
|
if (content.startsWith('[uploadedimage:')) {
|
||||||
@@ -132,14 +155,38 @@ class _NovelReadingPageState extends LoadingState<NovelReadingPage, String> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class TranslationController {
|
||||||
|
final String content;
|
||||||
|
|
||||||
|
final bool isTranslated;
|
||||||
|
|
||||||
|
final void Function(String translated) onTranslated;
|
||||||
|
|
||||||
|
final void Function() revert;
|
||||||
|
|
||||||
|
const TranslationController({
|
||||||
|
required this.content,
|
||||||
|
required this.isTranslated,
|
||||||
|
required this.onTranslated,
|
||||||
|
required this.revert,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
class _NovelReadingSettings extends StatefulWidget {
|
class _NovelReadingSettings extends StatefulWidget {
|
||||||
const _NovelReadingSettings(this.callback);
|
const _NovelReadingSettings(this.callback, this.controller);
|
||||||
|
|
||||||
final void Function() callback;
|
final void Function() callback;
|
||||||
|
|
||||||
static Future show(BuildContext context, void Function() callback) {
|
final TranslationController controller;
|
||||||
return Navigator.of(context)
|
|
||||||
.push(SideBarRoute(_NovelReadingSettings(callback)));
|
static Future show(
|
||||||
|
BuildContext context,
|
||||||
|
void Function() callback,
|
||||||
|
TranslationController controller,
|
||||||
|
) {
|
||||||
|
return Navigator.of(context).push(
|
||||||
|
SideBarRoute(_NovelReadingSettings(callback, controller)),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -256,9 +303,64 @@ class __NovelReadingSettingsState extends State<_NovelReadingSettings> {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
),
|
).paddingBottom(8),
|
||||||
|
Card(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
child: ListTile(
|
||||||
|
title: Text("Translate Novel".tl),
|
||||||
|
trailing: widget.controller.isTranslated
|
||||||
|
? Button(
|
||||||
|
onPressed: () {
|
||||||
|
widget.controller.revert();
|
||||||
|
context.pop();
|
||||||
|
},
|
||||||
|
child: Text("Revert".tl),
|
||||||
|
)
|
||||||
|
: Button(
|
||||||
|
onPressed: translate,
|
||||||
|
child: isTranslating
|
||||||
|
? const SizedBox(
|
||||||
|
width: 42,
|
||||||
|
height: 18,
|
||||||
|
child: Center(
|
||||||
|
child: SizedBox.square(
|
||||||
|
dimension: 18,
|
||||||
|
child: ProgressRing(
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Text("Translate".tl),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
).paddingHorizontal(8).paddingBottom(8),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isTranslating = false;
|
||||||
|
|
||||||
|
void translate() async {
|
||||||
|
setState(() {
|
||||||
|
isTranslating = true;
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
var translated = await Translator.instance
|
||||||
|
.translate(widget.controller.content, "zh-CN");
|
||||||
|
widget.controller.onTranslated(translated);
|
||||||
|
if (mounted) {
|
||||||
|
context.pop();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
setState(() {
|
||||||
|
isTranslating = false;
|
||||||
|
});
|
||||||
|
if (mounted) {
|
||||||
|
context.showToast(message: "Failed to translate".tl);
|
||||||
|
}
|
||||||
|
Log.error("Translate", e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@ class _RecommendationPageState extends State<RecommendationPage> {
|
|||||||
title: "Explore".tl,
|
title: "Explore".tl,
|
||||||
action: SegmentedButton<int>(
|
action: SegmentedButton<int>(
|
||||||
options: [
|
options: [
|
||||||
SegmentedButtonOption(0, "Artworks".tl),
|
SegmentedButtonOption(0, "Illustrations".tl),
|
||||||
SegmentedButtonOption(1, "Mangas".tl),
|
SegmentedButtonOption(1, "Mangas".tl),
|
||||||
SegmentedButtonOption(2, "Users".tl),
|
SegmentedButtonOption(2, "Users".tl),
|
||||||
],
|
],
|
||||||
|
69
lib/pages/related_page.dart
Normal file
69
lib/pages/related_page.dart
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
|
||||||
|
import 'package:pixes/components/illust_widget.dart';
|
||||||
|
import 'package:pixes/components/loading.dart';
|
||||||
|
import 'package:pixes/components/title_bar.dart';
|
||||||
|
import 'package:pixes/foundation/app.dart';
|
||||||
|
import 'package:pixes/network/network.dart';
|
||||||
|
import 'package:pixes/utils/translation.dart';
|
||||||
|
|
||||||
|
class RelatedIllustsPage extends StatefulWidget {
|
||||||
|
const RelatedIllustsPage(this.id, {super.key});
|
||||||
|
|
||||||
|
final String id;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<RelatedIllustsPage> createState() => _RelatedIllustsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _RelatedIllustsPageState
|
||||||
|
extends MultiPageLoadingState<RelatedIllustsPage, Illust> {
|
||||||
|
@override
|
||||||
|
Widget? buildFrame(BuildContext context, Widget child) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
TitleBar(title: "Related artworks".tl),
|
||||||
|
Expanded(
|
||||||
|
child: child,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildContent(BuildContext context, final List<Illust> data) {
|
||||||
|
return LayoutBuilder(builder: (context, constrains) {
|
||||||
|
return MasonryGridView.builder(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 8) +
|
||||||
|
EdgeInsets.only(bottom: context.padding.bottom),
|
||||||
|
gridDelegate: const SliverSimpleGridDelegateWithMaxCrossAxisExtent(
|
||||||
|
maxCrossAxisExtent: 240,
|
||||||
|
),
|
||||||
|
itemCount: data.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == data.length - 1) {
|
||||||
|
nextPage();
|
||||||
|
}
|
||||||
|
return IllustWidget(data[index]);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
String? nextUrl;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<Res<List<Illust>>> loadData(page) async {
|
||||||
|
if (nextUrl == "end") {
|
||||||
|
return Res.error("No more data");
|
||||||
|
}
|
||||||
|
var res = nextUrl == null
|
||||||
|
? await Network().relatedIllusts(widget.id)
|
||||||
|
: await Network().getIllustsWithNextUrl(nextUrl!);
|
||||||
|
if (!res.error) {
|
||||||
|
nextUrl = res.subData;
|
||||||
|
nextUrl ??= "end";
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
@@ -100,16 +100,18 @@ class _SearchPageState extends State<SearchPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextBox(
|
child: TextBox(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||||
placeholder:
|
placeholder:
|
||||||
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
'${searchTypes[searchType].tl} / ${"Open link".tl}',
|
||||||
onChanged: (s) => text = s,
|
onChanged: (s) => text = s,
|
||||||
onSubmitted: (s) => search(),
|
onSubmitted: (s) => search(),
|
||||||
foregroundDecoration: BoxDecoration(
|
foregroundDecoration: WidgetStatePropertyAll(
|
||||||
border: Border.all(
|
BoxDecoration(
|
||||||
color: ColorScheme.of(context)
|
border: Border.all(
|
||||||
.outlineVariant
|
color: ColorScheme.of(context)
|
||||||
.withOpacity(0.6)),
|
.outlineVariant
|
||||||
borderRadius: BorderRadius.circular(4)),
|
.toOpacity(0.6)),
|
||||||
|
borderRadius: BorderRadius.circular(4))),
|
||||||
suffix: MouseRegion(
|
suffix: MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@@ -246,7 +248,7 @@ class _TrendingTagsViewState
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: FluentTheme.of(context)
|
color: FluentTheme.of(context)
|
||||||
.micaBackgroundColor
|
.micaBackgroundColor
|
||||||
.withOpacity(0.84),
|
.toOpacity(0.84),
|
||||||
borderRadius: BorderRadius.circular(4)),
|
borderRadius: BorderRadius.circular(4)),
|
||||||
child: Text(text)
|
child: Text(text)
|
||||||
.paddingHorizontal(4)
|
.paddingHorizontal(4)
|
||||||
@@ -418,6 +420,19 @@ class _SearchSettingsState extends State<SearchSettings> {
|
|||||||
}))
|
}))
|
||||||
.toList(),
|
.toList(),
|
||||||
)),
|
)),
|
||||||
|
const SizedBox(height: 4),
|
||||||
|
Center(
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const Icon(FluentIcons.info, size: 16),
|
||||||
|
const SizedBox(
|
||||||
|
width: 4,
|
||||||
|
),
|
||||||
|
Text("Close the pane to apply the settings".tl)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: context.padding.bottom,
|
height: context.padding.bottom,
|
||||||
)
|
)
|
||||||
@@ -455,6 +470,12 @@ class _SearchResultPageState
|
|||||||
|
|
||||||
late final controller = TextEditingController(text: widget.keyword);
|
late final controller = TextEditingController(text: widget.keyword);
|
||||||
|
|
||||||
|
@override
|
||||||
|
void reset() {
|
||||||
|
nextUrl = null;
|
||||||
|
super.reset();
|
||||||
|
}
|
||||||
|
|
||||||
void search() {
|
void search() {
|
||||||
if (keyword != oldKeyword) {
|
if (keyword != oldKeyword) {
|
||||||
oldKeyword = keyword;
|
oldKeyword = keyword;
|
||||||
@@ -516,12 +537,16 @@ class _SearchResultPageState
|
|||||||
placeholder: "Search artworks".tl,
|
placeholder: "Search artworks".tl,
|
||||||
onChanged: (s) => keyword = s,
|
onChanged: (s) => keyword = s,
|
||||||
onSubmitted: (s) => search(),
|
onSubmitted: (s) => search(),
|
||||||
foregroundDecoration: BoxDecoration(
|
foregroundDecoration: WidgetStatePropertyAll(
|
||||||
|
BoxDecoration(
|
||||||
border: Border.all(
|
border: Border.all(
|
||||||
color: ColorScheme.of(context)
|
color: ColorScheme.of(context)
|
||||||
.outlineVariant
|
.outlineVariant
|
||||||
.withOpacity(0.6)),
|
.toOpacity(0.6),
|
||||||
borderRadius: BorderRadius.circular(4)),
|
),
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
),
|
||||||
suffix: MouseRegion(
|
suffix: MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
@@ -708,12 +733,14 @@ class _SearchNovelResultPageState
|
|||||||
placeholder: "Search artworks".tl,
|
placeholder: "Search artworks".tl,
|
||||||
onChanged: (s) => keyword = s,
|
onChanged: (s) => keyword = s,
|
||||||
onSubmitted: (s) => search(),
|
onSubmitted: (s) => search(),
|
||||||
foregroundDecoration: BoxDecoration(
|
foregroundDecoration: WidgetStatePropertyAll(
|
||||||
border: Border.all(
|
BoxDecoration(
|
||||||
color: ColorScheme.of(context)
|
border: Border.all(
|
||||||
.outlineVariant
|
color: ColorScheme.of(context)
|
||||||
.withOpacity(0.6)),
|
.outlineVariant
|
||||||
borderRadius: BorderRadius.circular(4)),
|
.toOpacity(0.6)),
|
||||||
|
borderRadius: BorderRadius.circular(4)),
|
||||||
|
),
|
||||||
suffix: MouseRegion(
|
suffix: MouseRegion(
|
||||||
cursor: SystemMouseCursors.click,
|
cursor: SystemMouseCursors.click,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
|
@@ -182,6 +182,16 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
buildItem(title: "Version", subtitle: App.version),
|
buildItem(title: "Version", subtitle: App.version),
|
||||||
|
buildItem(
|
||||||
|
title: "Check for updates on startup".tl,
|
||||||
|
action: ToggleSwitch(
|
||||||
|
checked: appdata.settings["checkUpdate"],
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
appdata.settings["checkUpdate"] = value;
|
||||||
|
});
|
||||||
|
appdata.writeData();
|
||||||
|
})),
|
||||||
buildItem(
|
buildItem(
|
||||||
title: "Github",
|
title: "Github",
|
||||||
action: IconButton(
|
action: IconButton(
|
||||||
@@ -218,6 +228,14 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
return SliverToBoxAdapter(
|
return SliverToBoxAdapter(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
buildItem(
|
||||||
|
title: "Initial Page".tl,
|
||||||
|
action: Button(
|
||||||
|
child: Text("Edit".tl).fixWidth(64),
|
||||||
|
onPressed: () {
|
||||||
|
context.to(() => const _SetInitialPageWidget());
|
||||||
|
},
|
||||||
|
)),
|
||||||
buildItem(
|
buildItem(
|
||||||
title: "Proxy".tl,
|
title: "Proxy".tl,
|
||||||
action: Button(
|
action: Button(
|
||||||
@@ -263,6 +281,19 @@ class _SettingsPageState extends State<SettingsPage> {
|
|||||||
});
|
});
|
||||||
appdata.writeData();
|
appdata.writeData();
|
||||||
})),
|
})),
|
||||||
|
buildItem(
|
||||||
|
title: "Emphasize artworks from following artists".tl,
|
||||||
|
subtitle: "The border of the artworks will be darker".tl,
|
||||||
|
action: ToggleSwitch(
|
||||||
|
checked:
|
||||||
|
appdata.settings['emphasizeArtworksFromFollowingArtists'],
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
appdata.settings[
|
||||||
|
'emphasizeArtworksFromFollowingArtists'] = value;
|
||||||
|
});
|
||||||
|
appdata.writeData();
|
||||||
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -639,3 +670,68 @@ class _ShortcutsSettingsState extends State<ShortcutsSettings> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _SetInitialPageWidget extends StatefulWidget {
|
||||||
|
const _SetInitialPageWidget();
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<_SetInitialPageWidget> createState() => _SetInitialPageWidgetState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SetInitialPageWidgetState extends State<_SetInitialPageWidget> {
|
||||||
|
int index = appdata.settings["initialPage"] ?? 4;
|
||||||
|
|
||||||
|
static const pageNames = [
|
||||||
|
"Search",
|
||||||
|
"Downloading",
|
||||||
|
"Downloaded",
|
||||||
|
"Explore",
|
||||||
|
"Bookmarks",
|
||||||
|
"Following",
|
||||||
|
"History",
|
||||||
|
"Ranking",
|
||||||
|
"Recommendation",
|
||||||
|
"Bookmarks",
|
||||||
|
"Ranking",
|
||||||
|
];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ScaffoldPage(
|
||||||
|
header: TitleBar(title: "Initial Page".tl),
|
||||||
|
content: ListView.builder(
|
||||||
|
itemCount: pageNames.length + 2,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
if (index == 3) {
|
||||||
|
return Text('${"Illustrations".tl}/${"Manga".tl}').paddingHorizontal(16).paddingVertical(8);
|
||||||
|
} else if (index > 3) {
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
if (index == 8) {
|
||||||
|
return Text("Novel".tl).paddingHorizontal(16).paddingVertical(8);
|
||||||
|
} else if (index > 8) {
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Card(
|
||||||
|
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
child: ListTile(
|
||||||
|
title: Text(pageNames[index].tl),
|
||||||
|
trailing: RadioButton(
|
||||||
|
checked: this.index - 1 == index,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
this.index = index + 1;
|
||||||
|
appdata.settings["initialPage"] = index + 1;
|
||||||
|
appdata.writeData();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -63,7 +63,7 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
|||||||
_RelatedUsers(widget.id),
|
_RelatedUsers(widget.id),
|
||||||
buildInformation(),
|
buildInformation(),
|
||||||
buildArtworkHeader(),
|
buildArtworkHeader(),
|
||||||
if (page == 2)
|
if (page == 4)
|
||||||
_UserNovels(widget.id)
|
_UserNovels(widget.id)
|
||||||
else
|
else
|
||||||
_UserArtworks(
|
_UserArtworks(
|
||||||
@@ -228,8 +228,10 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
|||||||
SegmentedButton<int>(
|
SegmentedButton<int>(
|
||||||
options: [
|
options: [
|
||||||
SegmentedButtonOption(0, "Artworks".tl),
|
SegmentedButtonOption(0, "Artworks".tl),
|
||||||
SegmentedButtonOption(1, "Bookmarks".tl),
|
SegmentedButtonOption(1, "Illustrations".tl),
|
||||||
SegmentedButtonOption(2, "Novels".tl),
|
SegmentedButtonOption(2, "Mangas".tl),
|
||||||
|
SegmentedButtonOption(3, "Bookmarks".tl),
|
||||||
|
SegmentedButtonOption(4, "Novels".tl),
|
||||||
],
|
],
|
||||||
value: page,
|
value: page,
|
||||||
onPressed: (value) {
|
onPressed: (value) {
|
||||||
@@ -239,15 +241,24 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (page != 2)
|
if (page != 4)
|
||||||
BatchDownloadButton(
|
BatchDownloadButton(
|
||||||
request: () {
|
request: () {
|
||||||
if (page == 0) {
|
switch (page) {
|
||||||
return Network().getUserIllusts(data!.id.toString());
|
case 0:
|
||||||
} else {
|
return Network()
|
||||||
return Network()
|
.getUserIllusts(data!.id.toString(), null);
|
||||||
.getUserBookmarks(data!.id.toString());
|
case 1:
|
||||||
|
return Network()
|
||||||
|
.getUserIllusts(data!.id.toString(), "illust");
|
||||||
|
case 2:
|
||||||
|
return Network()
|
||||||
|
.getUserIllusts(data!.id.toString(), "manga");
|
||||||
|
case 3:
|
||||||
|
return Network()
|
||||||
|
.getUserBookmarks(data!.id.toString());
|
||||||
}
|
}
|
||||||
|
throw "Invalid page";
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -269,14 +280,14 @@ class _UserInfoPageState extends LoadingState<UserInfoPage, UserDetails> {
|
|||||||
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 2),
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
leading: icon == null
|
title: Row(
|
||||||
? null
|
children: [
|
||||||
: Icon(
|
Icon(icon, size: 20),
|
||||||
icon,
|
const SizedBox(width: 8),
|
||||||
size: 20,
|
Text(title)
|
||||||
),
|
],
|
||||||
title: Text(title),
|
),
|
||||||
subtitle: SelectableText(content),
|
subtitle: SelectableText(content).paddingLeft(icon == null ? 0 : 28),
|
||||||
trailing: trailing,
|
trailing: trailing,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@@ -409,8 +420,9 @@ class _UserArtworksState extends MultiPageLoadingState<_UserArtworks, Illust> {
|
|||||||
return Res.error("No more data");
|
return Res.error("No more data");
|
||||||
}
|
}
|
||||||
var res = nextUrl == null
|
var res = nextUrl == null
|
||||||
? (widget.type == 0
|
? (widget.type != 3
|
||||||
? await Network().getUserIllusts(widget.uid)
|
? await Network().getUserIllusts(
|
||||||
|
widget.uid, [null, "illust", "manga"][widget.type])
|
||||||
: await Network().getUserBookmarks(widget.uid))
|
: await Network().getUserBookmarks(widget.uid))
|
||||||
: await Network().getIllustsWithNextUrl(nextUrl!);
|
: await Network().getIllustsWithNextUrl(nextUrl!);
|
||||||
if (!res.error) {
|
if (!res.error) {
|
||||||
@@ -422,7 +434,7 @@ class _UserArtworksState extends MultiPageLoadingState<_UserArtworks, Illust> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _UserNovels extends StatefulWidget {
|
class _UserNovels extends StatefulWidget {
|
||||||
const _UserNovels(this.uid, {super.key});
|
const _UserNovels(this.uid);
|
||||||
|
|
||||||
final String uid;
|
final String uid;
|
||||||
|
|
||||||
@@ -534,7 +546,7 @@ class _RelatedUsersState
|
|||||||
return UserPreviewWidget(data[index]).fixWidth(342);
|
return UserPreviewWidget(data[index]).fixWidth(342);
|
||||||
},
|
},
|
||||||
));
|
));
|
||||||
if (MediaQuery.of(context).size.width > 500) {
|
if (App.isDesktop) {
|
||||||
content = ScrollbarTheme.merge(
|
content = ScrollbarTheme.merge(
|
||||||
data: const ScrollbarThemeData(
|
data: const ScrollbarThemeData(
|
||||||
thickness: 6,
|
thickness: 6,
|
||||||
@@ -542,7 +554,21 @@ class _RelatedUsersState
|
|||||||
mainAxisMargin: 4,
|
mainAxisMargin: 4,
|
||||||
hoveringPadding: EdgeInsets.zero,
|
hoveringPadding: EdgeInsets.zero,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
hoveringMainAxisMargin: 4),
|
hoveringMainAxisMargin: 4,
|
||||||
|
crossAxisMargin: 0,
|
||||||
|
hoveringCrossAxisMargin: 0),
|
||||||
|
child: content);
|
||||||
|
} else {
|
||||||
|
content = ScrollbarTheme.merge(
|
||||||
|
data: const ScrollbarThemeData(
|
||||||
|
thickness: 4,
|
||||||
|
hoveringThickness: 4,
|
||||||
|
mainAxisMargin: 4,
|
||||||
|
hoveringPadding: EdgeInsets.zero,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
hoveringMainAxisMargin: 4,
|
||||||
|
crossAxisMargin: 0,
|
||||||
|
hoveringCrossAxisMargin: 0),
|
||||||
child: content);
|
child: content);
|
||||||
}
|
}
|
||||||
return MediaQuery.removePadding(
|
return MediaQuery.removePadding(
|
||||||
|
@@ -12,6 +12,14 @@ extension FSExt on FileSystemEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> deleteIgnoreError() async {
|
||||||
|
try {
|
||||||
|
await delete();
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int get size {
|
int get size {
|
||||||
if (this is File) {
|
if (this is File) {
|
||||||
return (this as File).lengthSync();
|
return (this as File).lengthSync();
|
||||||
|
69
lib/utils/update.dart
Normal file
69
lib/utils/update.dart
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
import 'package:fluent_ui/fluent_ui.dart';
|
||||||
|
import 'package:pixes/appdata.dart';
|
||||||
|
import 'package:pixes/foundation/app.dart';
|
||||||
|
import 'package:pixes/network/app_dio.dart';
|
||||||
|
import 'package:pixes/utils/translation.dart';
|
||||||
|
import 'package:url_launcher/url_launcher_string.dart';
|
||||||
|
|
||||||
|
Future<String> getLatestVersion() async {
|
||||||
|
var dio = AppDio();
|
||||||
|
var res = await dio
|
||||||
|
.get("https://raw.githubusercontent.com/wgh136/pixes/refs/heads/master/pubspec.yaml");
|
||||||
|
var lines = (res.data as String).split("\n");
|
||||||
|
for (var line in lines) {
|
||||||
|
if (line.startsWith("version:")) {
|
||||||
|
return line.split(":")[1].split('+')[0].trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw "Failed to get latest version";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Compare two versions.
|
||||||
|
/// Return `true` if `a` is greater than `b`.
|
||||||
|
bool compareVersion(String a, String b) {
|
||||||
|
var aList = a.split(".").map(int.parse).toList();
|
||||||
|
var bList = b.split(".").map(int.parse).toList();
|
||||||
|
for (var i = 0; i < aList.length; i++) {
|
||||||
|
if (aList[i] > bList[i]) {
|
||||||
|
return true;
|
||||||
|
} else if (aList[i] < bList[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> checkUpdate() async {
|
||||||
|
if (appdata.account == null) return;
|
||||||
|
try {
|
||||||
|
var latestVersion = await getLatestVersion();
|
||||||
|
if (compareVersion(latestVersion, App.version)) {
|
||||||
|
showDialog(
|
||||||
|
context: App.rootNavigatorKey.currentContext!,
|
||||||
|
builder: (context) => ContentDialog(
|
||||||
|
title: Text("New version available".tl),
|
||||||
|
content: Text(
|
||||||
|
"A new version of Pixes is available. Do you want to update now?"
|
||||||
|
.tl,
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
Button(
|
||||||
|
child: Text("Cancel".tl),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
FilledButton(
|
||||||
|
child: Text("Update".tl),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
launchUrlString(
|
||||||
|
"https://github.com/wgh136/pixes/releases/latest");
|
||||||
|
})
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// ignore
|
||||||
|
}
|
||||||
|
}
|
@@ -10,7 +10,7 @@
|
|||||||
#include <file_selector_linux/file_selector_plugin.h>
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
||||||
#include <gtk/gtk_plugin.h>
|
#include <gtk/gtk_plugin.h>
|
||||||
#include <screen_retriever/screen_retriever_plugin.h>
|
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
#include <window_manager/window_manager_plugin.h>
|
#include <window_manager/window_manager_plugin.h>
|
||||||
@@ -28,9 +28,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||||||
g_autoptr(FlPluginRegistrar) gtk_registrar =
|
g_autoptr(FlPluginRegistrar) gtk_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
|
||||||
gtk_plugin_register_with_registrar(gtk_registrar);
|
gtk_plugin_register_with_registrar(gtk_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) screen_retriever_registrar =
|
g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin");
|
||||||
screen_retriever_plugin_register_with_registrar(screen_retriever_registrar);
|
screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
g_autoptr(FlPluginRegistrar) sqlite3_flutter_libs_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "Sqlite3FlutterLibsPlugin");
|
||||||
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
sqlite3_flutter_libs_plugin_register_with_registrar(sqlite3_flutter_libs_registrar);
|
||||||
|
@@ -7,7 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||||||
file_selector_linux
|
file_selector_linux
|
||||||
flutter_acrylic
|
flutter_acrylic
|
||||||
gtk
|
gtk
|
||||||
screen_retriever
|
screen_retriever_linux
|
||||||
sqlite3_flutter_libs
|
sqlite3_flutter_libs
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
window_manager
|
window_manager
|
||||||
|
@@ -11,10 +11,11 @@ import dynamic_color
|
|||||||
import file_selector_macos
|
import file_selector_macos
|
||||||
import flutter_acrylic
|
import flutter_acrylic
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import screen_retriever
|
import screen_retriever_macos
|
||||||
import share_plus
|
import share_plus
|
||||||
import sqlite3_flutter_libs
|
import sqlite3_flutter_libs
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
|
import webview_flutter_wkwebview
|
||||||
import window_manager
|
import window_manager
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
@@ -24,9 +25,10 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
FlutterAcrylicPlugin.register(with: registry.registrar(forPlugin: "FlutterAcrylicPlugin"))
|
FlutterAcrylicPlugin.register(with: registry.registrar(forPlugin: "FlutterAcrylicPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin"))
|
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
|
||||||
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin"))
|
||||||
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
Sqlite3FlutterLibsPlugin.register(with: registry.registrar(forPlugin: "Sqlite3FlutterLibsPlugin"))
|
||||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
|
FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
|
||||||
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
|
WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
|
||||||
}
|
}
|
||||||
|
@@ -3,10 +3,14 @@
|
|||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
<key>com.apple.security.app-sandbox</key>
|
<key>com.apple.security.app-sandbox</key>
|
||||||
<true/>
|
<false/>
|
||||||
<key>com.apple.security.cs.allow-jit</key>
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>com.apple.security.network.server</key>
|
<key>com.apple.security.network.server</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.files.user-selected.read-write</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
253
pubspec.lock
253
pubspec.lock
@@ -5,18 +5,42 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: app_links
|
name: app_links
|
||||||
sha256: "1c2b9e9c56d80d17610bcbd111b37187875c5d0ded8654caa1bda14ea753d001"
|
sha256: "433df2e61b10519407475d7f69e470789d23d593f28224c38ba1068597be7950"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.0.1"
|
version: "6.3.3"
|
||||||
|
app_links_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: app_links_linux
|
||||||
|
sha256: f5f7173a78609f3dfd4c2ff2c95bd559ab43c80a87dc6a095921d96c05688c81
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.3"
|
||||||
|
app_links_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: app_links_platform_interface
|
||||||
|
sha256: "05f5379577c513b534a29ddea68176a4d4802c46180ee8e2e966257158772a3f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.2"
|
||||||
|
app_links_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: app_links_web
|
||||||
|
sha256: af060ed76183f9e2b87510a9480e56a5352b6c249778d07bd2c95fc35632a555
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
archive:
|
archive:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: archive
|
name: archive
|
||||||
sha256: ecf4273855368121b1caed0d10d4513c7241dfc813f7d3c8933b36622ae9b265
|
sha256: "08064924cbf0ab88280a0c3f60db9dd24fec693927e725ecb176f16c629d1cb8"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.5.1"
|
version: "4.0.1"
|
||||||
async:
|
async:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -53,50 +77,58 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: collection
|
name: collection
|
||||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.19.0"
|
||||||
cross_file:
|
cross_file:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: cross_file
|
name: cross_file
|
||||||
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
|
sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.4+1"
|
version: "0.3.4+2"
|
||||||
crypto:
|
crypto:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: crypto
|
name: crypto
|
||||||
sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab
|
sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
version: "3.0.6"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: device_info_plus
|
name: device_info_plus
|
||||||
sha256: eead12d1a1ed83d8283ab4c2f3fca23ac4082f29f25f29dff0f758f57d06ec91
|
sha256: "4fa68e53e26ab17b70ca39f072c285562cfc1589df5bb1e9295db90f6645f431"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.1.0"
|
version: "11.2.0"
|
||||||
device_info_plus_platform_interface:
|
device_info_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: device_info_plus_platform_interface
|
name: device_info_plus_platform_interface
|
||||||
sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64
|
sha256: "0b04e02b30791224b31969eb1b50d723498f402971bff3630bca2ba839bd1ed2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "7.0.0"
|
version: "7.0.2"
|
||||||
dio:
|
dio:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: dio
|
name: dio
|
||||||
sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5"
|
sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.4.3+1"
|
version: "5.7.0"
|
||||||
|
dio_web_adapter:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: dio_web_adapter
|
||||||
|
sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.0.0"
|
||||||
dynamic_color:
|
dynamic_color:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -181,10 +213,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: file_selector_web
|
name: file_selector_web
|
||||||
sha256: "619e431b224711a3869e30dbd7d516f5f5a4f04b265013a50912f39e1abc88c8"
|
sha256: c4c0ea4224d97a60a7067eca0c8fd419e708ff830e0c83b11a48faf566cec3e7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.9.4+1"
|
version: "0.9.4+2"
|
||||||
file_selector_windows:
|
file_selector_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -205,10 +237,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: fluent_ui
|
name: fluent_ui
|
||||||
sha256: a8c76cb501303d108cb9bd33e516da7cfd078031ff427d68eab6069bf4492a2c
|
sha256: "069dc196e093864ba7252a3ed5cc4e28039f04fc9cb687f35aeaa2e2b265dd7e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.8.7"
|
version: "4.10.0"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -226,10 +258,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_file_dialog
|
name: flutter_file_dialog
|
||||||
sha256: "5a1507833473b38839056d63c5125750a6d12e904f78131324fa4632504de513"
|
sha256: "9344b8f07be6a1b6f9854b723fb0cf84a8094ba94761af1d213589d3cb087488"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.1"
|
version: "3.0.2"
|
||||||
flutter_lints:
|
flutter_lints:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description:
|
description:
|
||||||
@@ -256,6 +288,15 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_to_arch:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
path: "."
|
||||||
|
ref: "15bfead"
|
||||||
|
resolved-ref: "15bfead0380fda79b0256b37c73b886b0882f1bf"
|
||||||
|
url: "https://github.com/wgh136/flutter_to_arch"
|
||||||
|
source: git
|
||||||
|
version: "1.0.0"
|
||||||
flutter_web_plugins:
|
flutter_web_plugins:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -273,10 +314,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: http
|
name: http
|
||||||
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
|
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.1"
|
version: "1.2.2"
|
||||||
http_parser:
|
http_parser:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -290,7 +331,7 @@ packages:
|
|||||||
description:
|
description:
|
||||||
path: "."
|
path: "."
|
||||||
ref: master
|
ref: master
|
||||||
resolved-ref: "3f8c4d2cc41002d3ffdb770cab3b62583326ce01"
|
resolved-ref: "38a38c45d3ed229cbc1d827eb2b5aaad1a4519cd"
|
||||||
url: "https://github.com/wgh136/image_gallery_saver"
|
url: "https://github.com/wgh136/image_gallery_saver"
|
||||||
source: git
|
source: git
|
||||||
version: "2.0.0"
|
version: "2.0.0"
|
||||||
@@ -302,22 +343,38 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.19.0"
|
version: "0.19.0"
|
||||||
|
io:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: io
|
||||||
|
sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.4"
|
||||||
|
json_annotation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: json_annotation
|
||||||
|
sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.9.0"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker
|
name: leak_tracker
|
||||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "10.0.4"
|
version: "10.0.7"
|
||||||
leak_tracker_flutter_testing:
|
leak_tracker_flutter_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: leak_tracker_flutter_testing
|
name: leak_tracker_flutter_testing
|
||||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.0.3"
|
version: "3.0.8"
|
||||||
leak_tracker_testing:
|
leak_tracker_testing:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -346,10 +403,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: material_color_utilities
|
name: material_color_utilities
|
||||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.8.0"
|
version: "0.11.1"
|
||||||
math_expressions:
|
math_expressions:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -362,10 +419,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.12.0"
|
version: "1.15.0"
|
||||||
mime:
|
mime:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -386,18 +443,18 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: path_provider
|
name: path_provider
|
||||||
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
|
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.3"
|
version: "2.1.5"
|
||||||
path_provider_android:
|
path_provider_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: path_provider_android
|
name: path_provider_android
|
||||||
sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d
|
sha256: "4adf4fd5423ec60a29506c76581bc05854c55e3a0b72d35bb28d661c9686edf2"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.4"
|
version: "2.2.15"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -455,6 +512,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.1.8"
|
version: "2.1.8"
|
||||||
|
posix:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: posix
|
||||||
|
sha256: a0117dc2167805aa9125b82eee515cc891819bac2f538c83646d355b16f58b9a
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "6.0.1"
|
||||||
recase:
|
recase:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -467,10 +532,42 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: screen_retriever
|
name: screen_retriever
|
||||||
sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90"
|
sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.1.9"
|
version: "0.2.0"
|
||||||
|
screen_retriever_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_retriever_linux
|
||||||
|
sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
|
screen_retriever_macos:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_retriever_macos
|
||||||
|
sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
|
screen_retriever_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_retriever_platform_interface
|
||||||
|
sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
|
screen_retriever_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: screen_retriever_windows
|
||||||
|
sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.2.0"
|
||||||
scroll_pos:
|
scroll_pos:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -483,23 +580,23 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: share_plus
|
name: share_plus
|
||||||
sha256: ef3489a969683c4f3d0239010cc8b7a2a46543a8d139e111c06c558875083544
|
sha256: "6327c3f233729374d0abaafd61f6846115b2a481b4feddd8534211dc10659400"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "9.0.0"
|
version: "10.1.3"
|
||||||
share_plus_platform_interface:
|
share_plus_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: share_plus_platform_interface
|
name: share_plus_platform_interface
|
||||||
sha256: "0f9e4418835d1b2c3ae78fdb918251959106cefdbc4dd43526e182f80e82f6d4"
|
sha256: cc012a23fc2d479854e6c80150696c4a5f5bb62cb89af4de1c505cf78d0a5d0b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.0"
|
version: "5.0.2"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.99"
|
version: "0.0.0"
|
||||||
source_span:
|
source_span:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -520,10 +617,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: sqlite3
|
name: sqlite3
|
||||||
sha256: b384f598b813b347c5a7e5ffad82cbaff1bec3d1561af267041e66f6f0899295
|
sha256: cb7f4e9dc1b52b1fa350f7b3d41c662e75fc3d399555fa4e5efcf267e9a4fbb5
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.4.3"
|
version: "2.5.0"
|
||||||
sqlite3_flutter_libs:
|
sqlite3_flutter_libs:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -536,10 +633,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: stack_trace
|
name: stack_trace
|
||||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.11.1"
|
version: "1.12.0"
|
||||||
stream_channel:
|
stream_channel:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -552,10 +649,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: string_scanner
|
name: string_scanner
|
||||||
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
|
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.2.0"
|
version: "1.3.0"
|
||||||
term_glyph:
|
term_glyph:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -568,10 +665,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.0"
|
version: "0.7.3"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -584,10 +681,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: url_launcher
|
name: url_launcher
|
||||||
sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e"
|
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.2.6"
|
version: "6.3.1"
|
||||||
url_launcher_android:
|
url_launcher_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -632,18 +729,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_web
|
name: url_launcher_web
|
||||||
sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a"
|
sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.3.1"
|
version: "2.3.3"
|
||||||
url_launcher_windows:
|
url_launcher_windows:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: url_launcher_windows
|
name: url_launcher_windows
|
||||||
sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7
|
sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.1.1"
|
version: "3.1.3"
|
||||||
uuid:
|
uuid:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -664,34 +761,34 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: vm_service
|
name: vm_service
|
||||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.1"
|
version: "14.3.0"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: web
|
name: web
|
||||||
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
|
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.5.1"
|
version: "1.1.0"
|
||||||
webview_flutter:
|
webview_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: webview_flutter
|
name: webview_flutter
|
||||||
sha256: "25e1b6e839e8cbfbd708abc6f85ed09d1727e24e08e08c6b8590d7c65c9a8932"
|
sha256: "889a0a678e7c793c308c68739996227c9661590605e70b1f6cf6b9a6634f7aec"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.7.0"
|
version: "4.10.0"
|
||||||
webview_flutter_android:
|
webview_flutter_android:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_android
|
name: webview_flutter_android
|
||||||
sha256: dad3313c9ead95517bb1cae5e1c9d20ba83729d5a59e5e83c0a2d66203f27f91
|
sha256: "3d535126f7244871542b2f0b0fcf94629c9a14883250461f9abe1a6644c1c379"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.16.1"
|
version: "4.2.0"
|
||||||
webview_flutter_platform_interface:
|
webview_flutter_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -704,18 +801,18 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: webview_flutter_wkwebview
|
name: webview_flutter_wkwebview
|
||||||
sha256: "7affdf9d680c015b11587181171d3cad8093e449db1f7d9f0f08f4f33d24f9a0"
|
sha256: b7e92f129482460951d96ef9a46b49db34bd2e1621685de26e9eaafd9674e7eb
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "3.13.1"
|
version: "3.16.3"
|
||||||
win32:
|
win32:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: win32
|
name: win32
|
||||||
sha256: "0eaf06e3446824099858367950a813472af675116bf63f008a4c2a75ae13e9cb"
|
sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.5.0"
|
version: "5.5.4"
|
||||||
win32_registry:
|
win32_registry:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -728,10 +825,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: window_manager
|
name: window_manager
|
||||||
sha256: b3c895bdf936c77b83c5254bec2e6b3f066710c1f89c38b20b8acc382b525494
|
sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.8"
|
version: "0.4.3"
|
||||||
xdg_directories:
|
xdg_directories:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -740,6 +837,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.0.4"
|
version: "1.0.4"
|
||||||
|
yaml:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: yaml
|
||||||
|
sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.2"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.3.4 <4.0.0"
|
dart: ">=3.5.0 <4.0.0"
|
||||||
flutter: ">=3.19.0"
|
flutter: ">=3.27.0"
|
||||||
|
44
pubspec.yaml
44
pubspec.yaml
@@ -16,10 +16,11 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# 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
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.7+107
|
version: 1.1.0+110
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.3.4 <4.0.0'
|
sdk: '>=3.3.4 <4.0.0'
|
||||||
|
flutter: 3.27.0
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to work.
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
@@ -34,30 +35,30 @@ dependencies:
|
|||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
window_manager: ^0.3.8
|
window_manager: ^0.4.3
|
||||||
fluent_ui: ^4.8.7
|
fluent_ui: ^4.10.0
|
||||||
dynamic_color: ^1.7.0
|
dynamic_color: ^1.7.0
|
||||||
dio: ^5.4.3
|
dio: ^5.7.0
|
||||||
crypto:
|
crypto: ^3.0.6
|
||||||
intl:
|
intl:
|
||||||
path_provider:
|
path_provider: ^2.1.5
|
||||||
url_launcher: ^6.1.8
|
url_launcher: ^6.3.1
|
||||||
app_links: ^6.0.1
|
app_links: ^6.3.3
|
||||||
win32_registry: ^1.1.3
|
win32_registry: ^1.1.0
|
||||||
flutter_staggered_grid_view: ^0.7.0
|
flutter_staggered_grid_view: ^0.7.0
|
||||||
sqlite3: ^2.4.3
|
sqlite3: ^2.5.0
|
||||||
sqlite3_flutter_libs: any
|
sqlite3_flutter_libs: any
|
||||||
photo_view:
|
photo_view:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/wgh136/photo_view
|
url: https://github.com/wgh136/photo_view
|
||||||
ref: main
|
ref: main
|
||||||
share_plus: ^9.0.0
|
share_plus: ^10.1.3
|
||||||
file_selector: ^1.0.1
|
file_selector: ^1.0.1
|
||||||
flutter_file_dialog: 3.0.1
|
flutter_file_dialog: ^3.0.2
|
||||||
archive: ^3.5.1
|
archive: ^4.0.1
|
||||||
webview_flutter: ^4.7.0
|
webview_flutter: ^4.10.0
|
||||||
flutter_acrylic: 1.0.0+2
|
flutter_acrylic: 1.0.0+2
|
||||||
device_info_plus: ^10.1.0
|
device_info_plus: ^11.2.0
|
||||||
image_gallery_saver:
|
image_gallery_saver:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/wgh136/image_gallery_saver
|
url: https://github.com/wgh136/image_gallery_saver
|
||||||
@@ -72,10 +73,23 @@ dev_dependencies:
|
|||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
flutter_lints: ^3.0.0
|
flutter_lints: ^3.0.0
|
||||||
|
flutter_to_arch:
|
||||||
|
git:
|
||||||
|
url: https://github.com/wgh136/flutter_to_arch
|
||||||
|
ref: 15bfead
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
flutter_to_arch:
|
||||||
|
name: Pixes
|
||||||
|
icon: debian/gui/pixes.png
|
||||||
|
categories: Utility
|
||||||
|
keywords: Flutter;pixiv;images;
|
||||||
|
url: https://github.com/wgh136/pixes
|
||||||
|
depends:
|
||||||
|
- gtk3
|
||||||
|
|
||||||
# The following section is specific to Flutter packages.
|
# The following section is specific to Flutter packages.
|
||||||
flutter:
|
flutter:
|
||||||
|
|
||||||
|
@@ -24,8 +24,8 @@ DisableProgramGroupPage=yes
|
|||||||
; Uncomment the following line to run in non administrative install mode (install for current user only.)
|
; Uncomment the following line to run in non administrative install mode (install for current user only.)
|
||||||
;PrivilegesRequired=lowest
|
;PrivilegesRequired=lowest
|
||||||
PrivilegesRequiredOverridesAllowed=dialog
|
PrivilegesRequiredOverridesAllowed=dialog
|
||||||
OutputDir=C:\Users\wgh19\IdeaProjects\pixes\build\windows
|
OutputDir={#RootPath}\build\windows
|
||||||
OutputBaseFilename=pixes-windows-installer
|
OutputBaseFilename=pixes-{#MyAppVersion}-windows-installer
|
||||||
SetupIconFile={#RootPath}\windows\runner\resources\app_icon.ico
|
SetupIconFile={#RootPath}\windows\runner\resources\app_icon.ico
|
||||||
Compression=lzma
|
Compression=lzma
|
||||||
SolidCompression=yes
|
SolidCompression=yes
|
||||||
@@ -35,7 +35,7 @@ ArchitecturesAllowed=x64 arm64
|
|||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
Name: "chinesesimplified"; MessagesFile: "{#RootPath}\windows\ChineseSimplified.isl"
|
||||||
|
|
||||||
[Tasks]
|
[Tasks]
|
||||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||||
|
@@ -1,34 +1,18 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
import httpx
|
||||||
os.chdir(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
||||||
|
|
||||||
fontUse = '''
|
|
||||||
fonts:
|
|
||||||
- family: font
|
|
||||||
fonts:
|
|
||||||
- asset: assets/SourceHanSansSC-Regular.otf
|
|
||||||
'''
|
|
||||||
|
|
||||||
file = open('pubspec.yaml', 'r')
|
file = open('pubspec.yaml', 'r')
|
||||||
content = file.read()
|
content = file.read()
|
||||||
file.close()
|
file.close()
|
||||||
file = open('pubspec.yaml', 'a')
|
|
||||||
file.write(fontUse)
|
|
||||||
file.close()
|
|
||||||
|
|
||||||
subprocess.run(["flutter", "build", "windows"], shell=True)
|
subprocess.run(["flutter", "build", "windows"], shell=True)
|
||||||
|
|
||||||
file = open('pubspec.yaml', 'w')
|
version = str.split(str.split(content, 'version: ')[1], '+')[0]
|
||||||
file.write(content)
|
|
||||||
|
|
||||||
if os.path.exists("build/app-windows.zip"):
|
subprocess.run(["tar", "-a", "-c", "-f", f"build/windows/pixes-{version}-windows.zip", "-C", "build/windows/x64/runner/Release", "*"]
|
||||||
os.remove("build/app-windows.zip")
|
|
||||||
|
|
||||||
subprocess.run(["tar", "-a", "-c", "-f", "build/windows/x64/app-windows.zip", "-C", "build/windows/x64/runner/Release", "."]
|
|
||||||
, shell=True)
|
, shell=True)
|
||||||
|
|
||||||
version = str.split(str.split(content, 'version: ')[1], '+')[0]
|
|
||||||
issContent = ""
|
issContent = ""
|
||||||
file = open('windows/build.iss', 'r')
|
file = open('windows/build.iss', 'r')
|
||||||
issContent = file.read()
|
issContent = file.read()
|
||||||
@@ -40,7 +24,14 @@ file = open('windows/build.iss', 'w')
|
|||||||
file.write(newContent)
|
file.write(newContent)
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
|
if not os.path.exists("windows/ChineseSimplified.isl"):
|
||||||
|
# download ChineseSimplified.isl
|
||||||
|
url = "https://raw.githubusercontent.com/kira-96/Inno-Setup-Chinese-Simplified-Translation/refs/heads/main/ChineseSimplified.isl"
|
||||||
|
response = httpx.get(url)
|
||||||
|
with open('windows/ChineseSimplified.isl', 'wb') as file:
|
||||||
|
file.write(response.content)
|
||||||
|
|
||||||
subprocess.run(["iscc", "windows/build.iss"], shell=True)
|
subprocess.run(["iscc", "windows/build.iss"], shell=True)
|
||||||
|
|
||||||
with open('windows/build.iss', 'w') as file:
|
with open('windows/build.iss', 'w') as file:
|
||||||
file.write(issContent)
|
file.write(issContent)
|
@@ -10,7 +10,7 @@
|
|||||||
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
#include <dynamic_color/dynamic_color_plugin_c_api.h>
|
||||||
#include <file_selector_windows/file_selector_windows.h>
|
#include <file_selector_windows/file_selector_windows.h>
|
||||||
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
#include <flutter_acrylic/flutter_acrylic_plugin.h>
|
||||||
#include <screen_retriever/screen_retriever_plugin.h>
|
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
|
||||||
#include <share_plus/share_plus_windows_plugin_c_api.h>
|
#include <share_plus/share_plus_windows_plugin_c_api.h>
|
||||||
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
#include <sqlite3_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
@@ -25,8 +25,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||||
FlutterAcrylicPluginRegisterWithRegistrar(
|
FlutterAcrylicPluginRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FlutterAcrylicPlugin"));
|
registry->GetRegistrarForPlugin("FlutterAcrylicPlugin"));
|
||||||
ScreenRetrieverPluginRegisterWithRegistrar(
|
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("ScreenRetrieverPlugin"));
|
registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi"));
|
||||||
SharePlusWindowsPluginCApiRegisterWithRegistrar(
|
SharePlusWindowsPluginCApiRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
|
registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi"));
|
||||||
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
|
Sqlite3FlutterLibsPluginRegisterWithRegistrar(
|
||||||
|
@@ -7,7 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||||||
dynamic_color
|
dynamic_color
|
||||||
file_selector_windows
|
file_selector_windows
|
||||||
flutter_acrylic
|
flutter_acrylic
|
||||||
screen_retriever
|
screen_retriever_windows
|
||||||
share_plus
|
share_plus
|
||||||
sqlite3_flutter_libs
|
sqlite3_flutter_libs
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
|
Reference in New Issue
Block a user