Compare commits
2 Commits
feature-se
...
feature-au
Author | SHA1 | Date | |
---|---|---|---|
cb3fd24cf7 | |||
3e8216923f |
208
.github/workflows/beta_ci.yml
vendored
@ -1,208 +0,0 @@
|
|||||||
name: Pilipala Beta
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "main"
|
|
||||||
paths-ignore:
|
|
||||||
- "**.md"
|
|
||||||
- "**.txt"
|
|
||||||
- ".github/**"
|
|
||||||
- ".idea/**"
|
|
||||||
- "!.github/workflows/**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update_version:
|
|
||||||
name: Read and update version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
outputs:
|
|
||||||
# 定义输出变量 version,以便在其他job中引用
|
|
||||||
new_version: ${{ steps.version.outputs.new_version }}
|
|
||||||
last_commit: ${{ steps.get-last-commit.outputs.last_commit }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.ref_name }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: 获取first parent commit次数
|
|
||||||
id: get-first-parent-commit-count
|
|
||||||
run: |
|
|
||||||
version=$(yq e .version pubspec.yaml | cut -d "+" -f 1)
|
|
||||||
recent_release_tag=$(git tag -l | grep $version | egrep -v "[-|+]" || true)
|
|
||||||
if [[ "x$recent_release_tag" == "x" ]]; then
|
|
||||||
echo "当前版本tag不存在,请手动生成tag."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
git log --oneline --first-parent $recent_release_tag..HEAD
|
|
||||||
first_parent_commit_count=$(git rev-list --first-parent --count $recent_release_tag..HEAD)
|
|
||||||
echo "count=$first_parent_commit_count" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 获取最后一次提交
|
|
||||||
id: get-last-commit
|
|
||||||
run: |
|
|
||||||
last_commit=$(git log -1 --pretty="%h %s" --first-parent)
|
|
||||||
echo "last_commit=$last_commit" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 更新版本号
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
# 读取版本号
|
|
||||||
VERSION=$(yq e .version pubspec.yaml | cut -d "+" -f 1)
|
|
||||||
|
|
||||||
# 获取GitHub Actions的run_number
|
|
||||||
#RUN_NUMBER=${{ github.run_number }}
|
|
||||||
|
|
||||||
# 构建新版本号
|
|
||||||
NEW_VERSION=$VERSION-beta.${{ steps.get-first-parent-commit-count.outputs.count }}
|
|
||||||
|
|
||||||
# 输出新版本号
|
|
||||||
echo "New version: $NEW_VERSION"
|
|
||||||
|
|
||||||
# 设置新版本号为输出变量
|
|
||||||
echo "new_version=$NEW_VERSION" >>$GITHUB_OUTPUT
|
|
||||||
|
|
||||||
android:
|
|
||||||
name: Build CI (Android)
|
|
||||||
needs: update_version
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: 构建Java环境
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: "zulu"
|
|
||||||
java-version: "17"
|
|
||||||
token: ${{secrets.GIT_TOKEN}}
|
|
||||||
|
|
||||||
- name: 检查缓存
|
|
||||||
uses: actions/cache@v2
|
|
||||||
id: cache-flutter
|
|
||||||
with:
|
|
||||||
path: /root/flutter-sdk
|
|
||||||
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
||||||
|
|
||||||
- name: 安装Flutter
|
|
||||||
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
flutter-version: 3.16.5
|
|
||||||
channel: any
|
|
||||||
|
|
||||||
- name: 下载项目依赖
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
- name: 解码生成 jks
|
|
||||||
run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks
|
|
||||||
env:
|
|
||||||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
|
||||||
|
|
||||||
- name: 更新版本号
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
# 更新pubspec.yaml文件中的版本号
|
|
||||||
sed -i "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml
|
|
||||||
|
|
||||||
- name: flutter build apk
|
|
||||||
run: flutter build apk --release --split-per-abi
|
|
||||||
env:
|
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
||||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
|
|
||||||
|
|
||||||
- name: 重命名应用
|
|
||||||
run: |
|
|
||||||
for file in build/app/outputs/flutter-apk/app-*.apk; do
|
|
||||||
if [[ $file =~ app-(.?*)release.apk ]]; then
|
|
||||||
new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}v${{ needs.update_version.outputs.new_version }}.apk"
|
|
||||||
mv "$file" "$new_file_name"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: 上传
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: Pilipala-Beta
|
|
||||||
path: |
|
|
||||||
build/app/outputs/flutter-apk/Pili-*.apk
|
|
||||||
|
|
||||||
iOS:
|
|
||||||
name: Build CI (iOS)
|
|
||||||
needs: update_version
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: 安装Flutter
|
|
||||||
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
|
||||||
uses: subosito/flutter-action@v2.10.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: 3.16.5
|
|
||||||
|
|
||||||
- name: 更新版本号
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
# 更新pubspec.yaml文件中的版本号
|
|
||||||
sed -i "" "s/version: .*+/version: ${{ needs.update_version.outputs.new_version }}+/g" pubspec.yaml
|
|
||||||
|
|
||||||
- name: flutter build ipa
|
|
||||||
run: |
|
|
||||||
flutter build ios --release --no-codesign
|
|
||||||
ln -sf ./build/ios/iphoneos Payload
|
|
||||||
zip -r9 app.ipa Payload/runner.app
|
|
||||||
|
|
||||||
- name: 重命名应用
|
|
||||||
run: |
|
|
||||||
DATE=${{ steps.date.outputs.date }}
|
|
||||||
for file in app.ipa; do
|
|
||||||
new_file_name="build/Pili-v${{ needs.update_version.outputs.new_version }}.ipa"
|
|
||||||
mv "$file" "$new_file_name"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: 上传
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Pilipala-Beta
|
|
||||||
path: |
|
|
||||||
build/Pili-*.ipa
|
|
||||||
|
|
||||||
upload:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- update_version
|
|
||||||
- android
|
|
||||||
- iOS
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: Pilipala-Beta
|
|
||||||
path: ./Pilipala-Beta
|
|
||||||
|
|
||||||
- name: 发送到Telegram频道
|
|
||||||
uses: xireiki/channel-post@v1.0.7
|
|
||||||
with:
|
|
||||||
bot_token: ${{ secrets.BOT_TOKEN }}
|
|
||||||
chat_id: ${{ secrets.CHAT_ID }}
|
|
||||||
large_file: true
|
|
||||||
api_id: ${{ secrets.TELEGRAM_API_ID }}
|
|
||||||
api_hash: ${{ secrets.TELEGRAM_API_HASH }}
|
|
||||||
method: sendFile
|
|
||||||
path: Pilipala-Beta/*
|
|
||||||
parse_mode: Markdown
|
|
||||||
context: "*Beta版本: v${{ needs.update_version.outputs.new_version }}*\n更新内容: [${{ needs.update_version.outputs.last_commit }}](${{ github.event.head_commit.url }})"
|
|
84
.github/workflows/main.yml
vendored
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
name: build_apk
|
||||||
|
|
||||||
|
# action事件触发
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
# push tag时触发
|
||||||
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
|
|
||||||
|
# 可以有多个jobs
|
||||||
|
jobs:
|
||||||
|
build_apk:
|
||||||
|
# 运行环境 ubuntu-latest window-latest mac-latest
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# 每个jobs中可以有多个steps
|
||||||
|
steps:
|
||||||
|
- name: 代码迁出
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: 构建Java环境
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: "zulu"
|
||||||
|
java-version: "17"
|
||||||
|
token: ${{secrets.GIT_TOKEN}}
|
||||||
|
|
||||||
|
- name: 检查缓存
|
||||||
|
uses: actions/cache@v2
|
||||||
|
id: cache-flutter
|
||||||
|
with:
|
||||||
|
path: /root/flutter-sdk # Flutter SDK 的路径
|
||||||
|
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
||||||
|
|
||||||
|
- name: 安装Flutter
|
||||||
|
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
||||||
|
uses: subosito/flutter-action@v2
|
||||||
|
with:
|
||||||
|
flutter-version: 3.10.6
|
||||||
|
channel: any
|
||||||
|
|
||||||
|
- name: 下载项目依赖
|
||||||
|
run: flutter pub get
|
||||||
|
|
||||||
|
- name: 解码生成 jks
|
||||||
|
run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks
|
||||||
|
env:
|
||||||
|
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
||||||
|
|
||||||
|
- name: flutter build apk
|
||||||
|
# 对应 android/app/build.gradle signingConfigs中的配置项
|
||||||
|
run: flutter build apk --release --split-per-abi
|
||||||
|
env:
|
||||||
|
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
||||||
|
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
||||||
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
|
||||||
|
|
||||||
|
- name: 获取版本号
|
||||||
|
id: version
|
||||||
|
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# - name: 获取当前日期
|
||||||
|
# id: date
|
||||||
|
# run: echo "date=$(date +'%m%d')" >>$GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: 重命名应用 Pili-arm64-v8a-*.*.*.0101.apk
|
||||||
|
run: |
|
||||||
|
# DATE=${{ steps.date.outputs.date }}
|
||||||
|
for file in build/app/outputs/flutter-apk/app-*-release.apk; do
|
||||||
|
if [[ $file =~ app-(.*)-release.apk ]]; then
|
||||||
|
new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}-${{ steps.version.outputs.version }}.apk"
|
||||||
|
mv "$file" "$new_file_name"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: 构建和发布release
|
||||||
|
uses: ncipollo/release-action@v1
|
||||||
|
with:
|
||||||
|
# release title
|
||||||
|
name: v${{ steps.version.outputs.version }}
|
||||||
|
artifacts: "build/app/outputs/flutter-apk/Pili-*.apk"
|
||||||
|
bodyFile: "change_log/${{steps.version.outputs.version}}.md"
|
||||||
|
token: ${{ secrets.GIT_TOKEN }}
|
||||||
|
allowUpdates: true
|
157
.github/workflows/release_ci.yml
vendored
@ -1,157 +0,0 @@
|
|||||||
name: Pilipala Release
|
|
||||||
|
|
||||||
# action事件触发
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
# push tag时触发
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
# 可以有多个jobs
|
|
||||||
jobs:
|
|
||||||
android:
|
|
||||||
# 运行环境 ubuntu-latest window-latest mac-latest
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
# 每个jobs中可以有多个steps
|
|
||||||
steps:
|
|
||||||
- name: 代码迁出
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: 构建Java环境
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: "zulu"
|
|
||||||
java-version: "17"
|
|
||||||
token: ${{secrets.GIT_TOKEN}}
|
|
||||||
|
|
||||||
- name: 检查缓存
|
|
||||||
uses: actions/cache@v2
|
|
||||||
id: cache-flutter
|
|
||||||
with:
|
|
||||||
path: /root/flutter-sdk # Flutter SDK 的路径
|
|
||||||
key: ${{ runner.os }}-flutter-${{ hashFiles('**/pubspec.lock') }}
|
|
||||||
|
|
||||||
- name: 安装Flutter
|
|
||||||
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
|
||||||
uses: subosito/flutter-action@v2
|
|
||||||
with:
|
|
||||||
flutter-version: 3.16.5
|
|
||||||
channel: any
|
|
||||||
|
|
||||||
- name: 下载项目依赖
|
|
||||||
run: flutter pub get
|
|
||||||
|
|
||||||
- name: 解码生成 jks
|
|
||||||
run: echo $KEYSTORE_BASE64 | base64 -di > android/app/vvex.jks
|
|
||||||
env:
|
|
||||||
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
|
|
||||||
|
|
||||||
- name: flutter build apk
|
|
||||||
run: flutter build apk --release --split-per-abi
|
|
||||||
env:
|
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
||||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
|
|
||||||
|
|
||||||
- name: flutter build apk
|
|
||||||
run: flutter build apk --release
|
|
||||||
env:
|
|
||||||
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
|
|
||||||
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
|
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD}}
|
|
||||||
|
|
||||||
- name: 获取版本号
|
|
||||||
id: version
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
|
||||||
|
|
||||||
# - name: 获取当前日期
|
|
||||||
# id: date
|
|
||||||
# run: echo "date=$(date +'%m%d')" >>$GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 重命名应用
|
|
||||||
run: |
|
|
||||||
# DATE=${{ steps.date.outputs.date }}
|
|
||||||
for file in build/app/outputs/flutter-apk/app-*.apk; do
|
|
||||||
if [[ $file =~ app-(.?*)release.apk ]]; then
|
|
||||||
new_file_name="build/app/outputs/flutter-apk/Pili-${BASH_REMATCH[1]}${{ steps.version.outputs.version }}.apk"
|
|
||||||
mv "$file" "$new_file_name"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: 上传
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: Pilipala-Release
|
|
||||||
path: |
|
|
||||||
build/app/outputs/flutter-apk/Pili-*.apk
|
|
||||||
|
|
||||||
iOS:
|
|
||||||
runs-on: macos-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: 代码迁出
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: 安装Flutter
|
|
||||||
if: steps.cache-flutter.outputs.cache-hit != 'true'
|
|
||||||
uses: subosito/flutter-action@v2.10.0
|
|
||||||
with:
|
|
||||||
cache: true
|
|
||||||
flutter-version: 3.16.5
|
|
||||||
|
|
||||||
- name: flutter build ipa
|
|
||||||
run: |
|
|
||||||
flutter build ios --release --no-codesign
|
|
||||||
ln -sf ./build/ios/iphoneos Payload
|
|
||||||
zip -r9 app.ipa Payload/runner.app
|
|
||||||
|
|
||||||
- name: 获取版本号
|
|
||||||
id: version
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: 重命名应用
|
|
||||||
run: |
|
|
||||||
DATE=${{ steps.date.outputs.date }}
|
|
||||||
for file in app.ipa; do
|
|
||||||
new_file_name="build/Pili-${{ steps.version.outputs.version }}.ipa"
|
|
||||||
mv "$file" "$new_file_name"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: 上传
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
if-no-files-found: error
|
|
||||||
name: Pilipala-Release
|
|
||||||
path: |
|
|
||||||
build/Pili-*.ipa
|
|
||||||
|
|
||||||
upload:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
needs:
|
|
||||||
- android
|
|
||||||
- iOS
|
|
||||||
steps:
|
|
||||||
- uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: Pilipala-Release
|
|
||||||
path: ./Pilipala-Release
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: sudo apt-get install tree -y
|
|
||||||
|
|
||||||
- name: Get version
|
|
||||||
id: version
|
|
||||||
run: echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload Release
|
|
||||||
uses: ncipollo/release-action@v1
|
|
||||||
with:
|
|
||||||
name: v${{ steps.version.outputs.version }}
|
|
||||||
token: ${{ secrets.GIT_TOKEN }}
|
|
||||||
omitBodyDuringUpdate: true
|
|
||||||
omitNameDuringUpdate: true
|
|
||||||
omitPrereleaseDuringUpdate: true
|
|
||||||
allowUpdates: true
|
|
||||||
artifacts: Pilipala-Release/*
|
|
106
.gitignore
vendored
@ -21,29 +21,6 @@ migrate_working_dir/
|
|||||||
# is commented out by default.
|
# is commented out by default.
|
||||||
#.vscode/
|
#.vscode/
|
||||||
|
|
||||||
# Flutter repo-specific
|
|
||||||
/bin/cache/
|
|
||||||
/bin/internal/bootstrap.bat
|
|
||||||
/bin/internal/bootstrap.sh
|
|
||||||
/bin/mingit/
|
|
||||||
/dev/benchmarks/mega_gallery/
|
|
||||||
/dev/bots/.recipe_deps
|
|
||||||
/dev/bots/android_tools/
|
|
||||||
/dev/devicelab/ABresults*.json
|
|
||||||
/dev/docs/doc/
|
|
||||||
/dev/docs/api_docs.zip
|
|
||||||
/dev/docs/flutter.docs.zip
|
|
||||||
/dev/docs/lib/
|
|
||||||
/dev/docs/pubspec.yaml
|
|
||||||
/dev/integration_tests/**/xcuserdata
|
|
||||||
/dev/integration_tests/**/Pods
|
|
||||||
/packages/flutter/coverage/
|
|
||||||
version
|
|
||||||
analysis_benchmark.json
|
|
||||||
|
|
||||||
# packages file containing multi-root paths
|
|
||||||
.packages.generated
|
|
||||||
|
|
||||||
# Flutter/Dart/Pub related
|
# Flutter/Dart/Pub related
|
||||||
**/doc/api/
|
**/doc/api/
|
||||||
**/ios/Flutter/.last_build_id
|
**/ios/Flutter/.last_build_id
|
||||||
@ -54,83 +31,14 @@ analysis_benchmark.json
|
|||||||
.pub-cache/
|
.pub-cache/
|
||||||
.pub/
|
.pub/
|
||||||
/build/
|
/build/
|
||||||
flutter_*.png
|
|
||||||
linked_*.ds
|
# Symbolication related
|
||||||
unlinked.ds
|
app.*.symbols
|
||||||
unlinked_spec.ds
|
|
||||||
|
|
||||||
# Obfuscation related
|
# Obfuscation related
|
||||||
app.*.map.json
|
app.*.map.json
|
||||||
|
|
||||||
# Android related
|
# Android Studio will place build artifacts here
|
||||||
**/android/**/gradle-wrapper.jar
|
/android/app/debug
|
||||||
.gradle/
|
/android/app/profile
|
||||||
**/android/captures/
|
/android/app/release
|
||||||
**/android/gradlew
|
|
||||||
**/android/gradlew.bat
|
|
||||||
**/android/local.properties
|
|
||||||
**/android/**/GeneratedPluginRegistrant.java
|
|
||||||
**/android/key.properties
|
|
||||||
*.jks
|
|
||||||
|
|
||||||
# iOS/XCode related
|
|
||||||
**/ios/**/*.mode1v3
|
|
||||||
**/ios/**/*.mode2v3
|
|
||||||
**/ios/**/*.moved-aside
|
|
||||||
**/ios/**/*.pbxuser
|
|
||||||
**/ios/**/*.perspectivev3
|
|
||||||
**/ios/**/*sync/
|
|
||||||
**/ios/**/.sconsign.dblite
|
|
||||||
**/ios/**/.tags*
|
|
||||||
**/ios/**/.vagrant/
|
|
||||||
**/ios/**/DerivedData/
|
|
||||||
**/ios/**/Icon?
|
|
||||||
**/ios/**/Pods/
|
|
||||||
**/ios/**/.symlinks/
|
|
||||||
**/ios/**/profile
|
|
||||||
**/ios/**/xcuserdata
|
|
||||||
**/ios/.generated/
|
|
||||||
**/ios/Flutter/.last_build_id
|
|
||||||
**/ios/Flutter/App.framework
|
|
||||||
**/ios/Flutter/Flutter.framework
|
|
||||||
**/ios/Flutter/Flutter.podspec
|
|
||||||
**/ios/Flutter/Generated.xcconfig
|
|
||||||
**/ios/Flutter/ephemeral
|
|
||||||
**/ios/Flutter/app.flx
|
|
||||||
**/ios/Flutter/app.zip
|
|
||||||
**/ios/Flutter/flutter_assets/
|
|
||||||
**/ios/Flutter/flutter_export_environment.sh
|
|
||||||
**/ios/ServiceDefinitions.json
|
|
||||||
**/ios/Runner/GeneratedPluginRegistrant.*
|
|
||||||
|
|
||||||
# macOS
|
|
||||||
**/Flutter/ephemeral/
|
|
||||||
**/Pods/
|
|
||||||
**/macos/Flutter/GeneratedPluginRegistrant.swift
|
|
||||||
**/macos/Flutter/ephemeral
|
|
||||||
**/xcuserdata/
|
|
||||||
|
|
||||||
# Windows
|
|
||||||
**/windows/flutter/generated_plugin_registrant.cc
|
|
||||||
**/windows/flutter/generated_plugin_registrant.h
|
|
||||||
**/windows/flutter/generated_plugins.cmake
|
|
||||||
|
|
||||||
# Linux
|
|
||||||
**/linux/flutter/generated_plugin_registrant.cc
|
|
||||||
**/linux/flutter/generated_plugin_registrant.h
|
|
||||||
**/linux/flutter/generated_plugins.cmake
|
|
||||||
|
|
||||||
# Coverage
|
|
||||||
coverage/
|
|
||||||
|
|
||||||
# Symbols
|
|
||||||
app.*.symbols
|
|
||||||
|
|
||||||
# Exceptions to above rules.
|
|
||||||
!**/ios/**/default.mode1v3
|
|
||||||
!**/ios/**/default.mode2v3
|
|
||||||
!**/ios/**/default.pbxuser
|
|
||||||
!**/ios/**/default.perspectivev3
|
|
||||||
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
|
|
||||||
!/dev/ci/**/Gemfile.lock
|
|
||||||
!.vscode/settings.json
|
|
||||||
|
674
LICENSE
@ -1,674 +0,0 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 3, 29 June 2007
|
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The GNU General Public License is a free, copyleft license for
|
|
||||||
software and other kinds of works.
|
|
||||||
|
|
||||||
The licenses for most software and other practical works are designed
|
|
||||||
to take away your freedom to share and change the works. By contrast,
|
|
||||||
the GNU General Public License is intended to guarantee your freedom to
|
|
||||||
share and change all versions of a program--to make sure it remains free
|
|
||||||
software for all its users. We, the Free Software Foundation, use the
|
|
||||||
GNU General Public License for most of our software; it applies also to
|
|
||||||
any other work released this way by its authors. You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
them if you wish), that you receive source code or can get it if you
|
|
||||||
want it, that you can change the software or use pieces of it in new
|
|
||||||
free programs, and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to prevent others from denying you
|
|
||||||
these rights or asking you to surrender the rights. Therefore, you have
|
|
||||||
certain responsibilities if you distribute copies of the software, or if
|
|
||||||
you modify it: responsibilities to respect the freedom of others.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must pass on to the recipients the same
|
|
||||||
freedoms that you received. You must make sure that they, too, receive
|
|
||||||
or can get the source code. And you must show them these terms so they
|
|
||||||
know their rights.
|
|
||||||
|
|
||||||
Developers that use the GNU GPL protect your rights with two steps:
|
|
||||||
(1) assert copyright on the software, and (2) offer you this License
|
|
||||||
giving you legal permission to copy, distribute and/or modify it.
|
|
||||||
|
|
||||||
For the developers' and authors' protection, the GPL clearly explains
|
|
||||||
that there is no warranty for this free software. For both users' and
|
|
||||||
authors' sake, the GPL requires that modified versions be marked as
|
|
||||||
changed, so that their problems will not be attributed erroneously to
|
|
||||||
authors of previous versions.
|
|
||||||
|
|
||||||
Some devices are designed to deny users access to install or run
|
|
||||||
modified versions of the software inside them, although the manufacturer
|
|
||||||
can do so. This is fundamentally incompatible with the aim of
|
|
||||||
protecting users' freedom to change the software. The systematic
|
|
||||||
pattern of such abuse occurs in the area of products for individuals to
|
|
||||||
use, which is precisely where it is most unacceptable. Therefore, we
|
|
||||||
have designed this version of the GPL to prohibit the practice for those
|
|
||||||
products. If such problems arise substantially in other domains, we
|
|
||||||
stand ready to extend this provision to those domains in future versions
|
|
||||||
of the GPL, as needed to protect the freedom of users.
|
|
||||||
|
|
||||||
Finally, every program is threatened constantly by software patents.
|
|
||||||
States should not allow patents to restrict development and use of
|
|
||||||
software on general-purpose computers, but in those that do, we wish to
|
|
||||||
avoid the special danger that patents applied to a free program could
|
|
||||||
make it effectively proprietary. To prevent this, the GPL assures that
|
|
||||||
patents cannot be used to render the program non-free.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
0. Definitions.
|
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
|
||||||
|
|
||||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
|
||||||
works, such as semiconductor masks.
|
|
||||||
|
|
||||||
"The Program" refers to any copyrightable work licensed under this
|
|
||||||
License. Each licensee is addressed as "you". "Licensees" and
|
|
||||||
"recipients" may be individuals or organizations.
|
|
||||||
|
|
||||||
To "modify" a work means to copy from or adapt all or part of the work
|
|
||||||
in a fashion requiring copyright permission, other than the making of an
|
|
||||||
exact copy. The resulting work is called a "modified version" of the
|
|
||||||
earlier work or a work "based on" the earlier work.
|
|
||||||
|
|
||||||
A "covered work" means either the unmodified Program or a work based
|
|
||||||
on the Program.
|
|
||||||
|
|
||||||
To "propagate" a work means to do anything with it that, without
|
|
||||||
permission, would make you directly or secondarily liable for
|
|
||||||
infringement under applicable copyright law, except executing it on a
|
|
||||||
computer or modifying a private copy. Propagation includes copying,
|
|
||||||
distribution (with or without modification), making available to the
|
|
||||||
public, and in some countries other activities as well.
|
|
||||||
|
|
||||||
To "convey" a work means any kind of propagation that enables other
|
|
||||||
parties to make or receive copies. Mere interaction with a user through
|
|
||||||
a computer network, with no transfer of a copy, is not conveying.
|
|
||||||
|
|
||||||
An interactive user interface displays "Appropriate Legal Notices"
|
|
||||||
to the extent that it includes a convenient and prominently visible
|
|
||||||
feature that (1) displays an appropriate copyright notice, and (2)
|
|
||||||
tells the user that there is no warranty for the work (except to the
|
|
||||||
extent that warranties are provided), that licensees may convey the
|
|
||||||
work under this License, and how to view a copy of this License. If
|
|
||||||
the interface presents a list of user commands or options, such as a
|
|
||||||
menu, a prominent item in the list meets this criterion.
|
|
||||||
|
|
||||||
1. Source Code.
|
|
||||||
|
|
||||||
The "source code" for a work means the preferred form of the work
|
|
||||||
for making modifications to it. "Object code" means any non-source
|
|
||||||
form of a work.
|
|
||||||
|
|
||||||
A "Standard Interface" means an interface that either is an official
|
|
||||||
standard defined by a recognized standards body, or, in the case of
|
|
||||||
interfaces specified for a particular programming language, one that
|
|
||||||
is widely used among developers working in that language.
|
|
||||||
|
|
||||||
The "System Libraries" of an executable work include anything, other
|
|
||||||
than the work as a whole, that (a) is included in the normal form of
|
|
||||||
packaging a Major Component, but which is not part of that Major
|
|
||||||
Component, and (b) serves only to enable use of the work with that
|
|
||||||
Major Component, or to implement a Standard Interface for which an
|
|
||||||
implementation is available to the public in source code form. A
|
|
||||||
"Major Component", in this context, means a major essential component
|
|
||||||
(kernel, window system, and so on) of the specific operating system
|
|
||||||
(if any) on which the executable work runs, or a compiler used to
|
|
||||||
produce the work, or an object code interpreter used to run it.
|
|
||||||
|
|
||||||
The "Corresponding Source" for a work in object code form means all
|
|
||||||
the source code needed to generate, install, and (for an executable
|
|
||||||
work) run the object code and to modify the work, including scripts to
|
|
||||||
control those activities. However, it does not include the work's
|
|
||||||
System Libraries, or general-purpose tools or generally available free
|
|
||||||
programs which are used unmodified in performing those activities but
|
|
||||||
which are not part of the work. For example, Corresponding Source
|
|
||||||
includes interface definition files associated with source files for
|
|
||||||
the work, and the source code for shared libraries and dynamically
|
|
||||||
linked subprograms that the work is specifically designed to require,
|
|
||||||
such as by intimate data communication or control flow between those
|
|
||||||
subprograms and other parts of the work.
|
|
||||||
|
|
||||||
The Corresponding Source need not include anything that users
|
|
||||||
can regenerate automatically from other parts of the Corresponding
|
|
||||||
Source.
|
|
||||||
|
|
||||||
The Corresponding Source for a work in source code form is that
|
|
||||||
same work.
|
|
||||||
|
|
||||||
2. Basic Permissions.
|
|
||||||
|
|
||||||
All rights granted under this License are granted for the term of
|
|
||||||
copyright on the Program, and are irrevocable provided the stated
|
|
||||||
conditions are met. This License explicitly affirms your unlimited
|
|
||||||
permission to run the unmodified Program. The output from running a
|
|
||||||
covered work is covered by this License only if the output, given its
|
|
||||||
content, constitutes a covered work. This License acknowledges your
|
|
||||||
rights of fair use or other equivalent, as provided by copyright law.
|
|
||||||
|
|
||||||
You may make, run and propagate covered works that you do not
|
|
||||||
convey, without conditions so long as your license otherwise remains
|
|
||||||
in force. You may convey covered works to others for the sole purpose
|
|
||||||
of having them make modifications exclusively for you, or provide you
|
|
||||||
with facilities for running those works, provided that you comply with
|
|
||||||
the terms of this License in conveying all material for which you do
|
|
||||||
not control copyright. Those thus making or running the covered works
|
|
||||||
for you must do so exclusively on your behalf, under your direction
|
|
||||||
and control, on terms that prohibit them from making any copies of
|
|
||||||
your copyrighted material outside their relationship with you.
|
|
||||||
|
|
||||||
Conveying under any other circumstances is permitted solely under
|
|
||||||
the conditions stated below. Sublicensing is not allowed; section 10
|
|
||||||
makes it unnecessary.
|
|
||||||
|
|
||||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
|
||||||
|
|
||||||
No covered work shall be deemed part of an effective technological
|
|
||||||
measure under any applicable law fulfilling obligations under article
|
|
||||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
|
||||||
similar laws prohibiting or restricting circumvention of such
|
|
||||||
measures.
|
|
||||||
|
|
||||||
When you convey a covered work, you waive any legal power to forbid
|
|
||||||
circumvention of technological measures to the extent such circumvention
|
|
||||||
is effected by exercising rights under this License with respect to
|
|
||||||
the covered work, and you disclaim any intention to limit operation or
|
|
||||||
modification of the work as a means of enforcing, against the work's
|
|
||||||
users, your or third parties' legal rights to forbid circumvention of
|
|
||||||
technological measures.
|
|
||||||
|
|
||||||
4. Conveying Verbatim Copies.
|
|
||||||
|
|
||||||
You may convey verbatim copies of the Program's source code as you
|
|
||||||
receive it, in any medium, provided that you conspicuously and
|
|
||||||
appropriately publish on each copy an appropriate copyright notice;
|
|
||||||
keep intact all notices stating that this License and any
|
|
||||||
non-permissive terms added in accord with section 7 apply to the code;
|
|
||||||
keep intact all notices of the absence of any warranty; and give all
|
|
||||||
recipients a copy of this License along with the Program.
|
|
||||||
|
|
||||||
You may charge any price or no price for each copy that you convey,
|
|
||||||
and you may offer support or warranty protection for a fee.
|
|
||||||
|
|
||||||
5. Conveying Modified Source Versions.
|
|
||||||
|
|
||||||
You may convey a work based on the Program, or the modifications to
|
|
||||||
produce it from the Program, in the form of source code under the
|
|
||||||
terms of section 4, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) The work must carry prominent notices stating that you modified
|
|
||||||
it, and giving a relevant date.
|
|
||||||
|
|
||||||
b) The work must carry prominent notices stating that it is
|
|
||||||
released under this License and any conditions added under section
|
|
||||||
7. This requirement modifies the requirement in section 4 to
|
|
||||||
"keep intact all notices".
|
|
||||||
|
|
||||||
c) You must license the entire work, as a whole, under this
|
|
||||||
License to anyone who comes into possession of a copy. This
|
|
||||||
License will therefore apply, along with any applicable section 7
|
|
||||||
additional terms, to the whole of the work, and all its parts,
|
|
||||||
regardless of how they are packaged. This License gives no
|
|
||||||
permission to license the work in any other way, but it does not
|
|
||||||
invalidate such permission if you have separately received it.
|
|
||||||
|
|
||||||
d) If the work has interactive user interfaces, each must display
|
|
||||||
Appropriate Legal Notices; however, if the Program has interactive
|
|
||||||
interfaces that do not display Appropriate Legal Notices, your
|
|
||||||
work need not make them do so.
|
|
||||||
|
|
||||||
A compilation of a covered work with other separate and independent
|
|
||||||
works, which are not by their nature extensions of the covered work,
|
|
||||||
and which are not combined with it such as to form a larger program,
|
|
||||||
in or on a volume of a storage or distribution medium, is called an
|
|
||||||
"aggregate" if the compilation and its resulting copyright are not
|
|
||||||
used to limit the access or legal rights of the compilation's users
|
|
||||||
beyond what the individual works permit. Inclusion of a covered work
|
|
||||||
in an aggregate does not cause this License to apply to the other
|
|
||||||
parts of the aggregate.
|
|
||||||
|
|
||||||
6. Conveying Non-Source Forms.
|
|
||||||
|
|
||||||
You may convey a covered work in object code form under the terms
|
|
||||||
of sections 4 and 5, provided that you also convey the
|
|
||||||
machine-readable Corresponding Source under the terms of this License,
|
|
||||||
in one of these ways:
|
|
||||||
|
|
||||||
a) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by the
|
|
||||||
Corresponding Source fixed on a durable physical medium
|
|
||||||
customarily used for software interchange.
|
|
||||||
|
|
||||||
b) Convey the object code in, or embodied in, a physical product
|
|
||||||
(including a physical distribution medium), accompanied by a
|
|
||||||
written offer, valid for at least three years and valid for as
|
|
||||||
long as you offer spare parts or customer support for that product
|
|
||||||
model, to give anyone who possesses the object code either (1) a
|
|
||||||
copy of the Corresponding Source for all the software in the
|
|
||||||
product that is covered by this License, on a durable physical
|
|
||||||
medium customarily used for software interchange, for a price no
|
|
||||||
more than your reasonable cost of physically performing this
|
|
||||||
conveying of source, or (2) access to copy the
|
|
||||||
Corresponding Source from a network server at no charge.
|
|
||||||
|
|
||||||
c) Convey individual copies of the object code with a copy of the
|
|
||||||
written offer to provide the Corresponding Source. This
|
|
||||||
alternative is allowed only occasionally and noncommercially, and
|
|
||||||
only if you received the object code with such an offer, in accord
|
|
||||||
with subsection 6b.
|
|
||||||
|
|
||||||
d) Convey the object code by offering access from a designated
|
|
||||||
place (gratis or for a charge), and offer equivalent access to the
|
|
||||||
Corresponding Source in the same way through the same place at no
|
|
||||||
further charge. You need not require recipients to copy the
|
|
||||||
Corresponding Source along with the object code. If the place to
|
|
||||||
copy the object code is a network server, the Corresponding Source
|
|
||||||
may be on a different server (operated by you or a third party)
|
|
||||||
that supports equivalent copying facilities, provided you maintain
|
|
||||||
clear directions next to the object code saying where to find the
|
|
||||||
Corresponding Source. Regardless of what server hosts the
|
|
||||||
Corresponding Source, you remain obligated to ensure that it is
|
|
||||||
available for as long as needed to satisfy these requirements.
|
|
||||||
|
|
||||||
e) Convey the object code using peer-to-peer transmission, provided
|
|
||||||
you inform other peers where the object code and Corresponding
|
|
||||||
Source of the work are being offered to the general public at no
|
|
||||||
charge under subsection 6d.
|
|
||||||
|
|
||||||
A separable portion of the object code, whose source code is excluded
|
|
||||||
from the Corresponding Source as a System Library, need not be
|
|
||||||
included in conveying the object code work.
|
|
||||||
|
|
||||||
A "User Product" is either (1) a "consumer product", which means any
|
|
||||||
tangible personal property which is normally used for personal, family,
|
|
||||||
or household purposes, or (2) anything designed or sold for incorporation
|
|
||||||
into a dwelling. In determining whether a product is a consumer product,
|
|
||||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
|
||||||
product received by a particular user, "normally used" refers to a
|
|
||||||
typical or common use of that class of product, regardless of the status
|
|
||||||
of the particular user or of the way in which the particular user
|
|
||||||
actually uses, or expects or is expected to use, the product. A product
|
|
||||||
is a consumer product regardless of whether the product has substantial
|
|
||||||
commercial, industrial or non-consumer uses, unless such uses represent
|
|
||||||
the only significant mode of use of the product.
|
|
||||||
|
|
||||||
"Installation Information" for a User Product means any methods,
|
|
||||||
procedures, authorization keys, or other information required to install
|
|
||||||
and execute modified versions of a covered work in that User Product from
|
|
||||||
a modified version of its Corresponding Source. The information must
|
|
||||||
suffice to ensure that the continued functioning of the modified object
|
|
||||||
code is in no case prevented or interfered with solely because
|
|
||||||
modification has been made.
|
|
||||||
|
|
||||||
If you convey an object code work under this section in, or with, or
|
|
||||||
specifically for use in, a User Product, and the conveying occurs as
|
|
||||||
part of a transaction in which the right of possession and use of the
|
|
||||||
User Product is transferred to the recipient in perpetuity or for a
|
|
||||||
fixed term (regardless of how the transaction is characterized), the
|
|
||||||
Corresponding Source conveyed under this section must be accompanied
|
|
||||||
by the Installation Information. But this requirement does not apply
|
|
||||||
if neither you nor any third party retains the ability to install
|
|
||||||
modified object code on the User Product (for example, the work has
|
|
||||||
been installed in ROM).
|
|
||||||
|
|
||||||
The requirement to provide Installation Information does not include a
|
|
||||||
requirement to continue to provide support service, warranty, or updates
|
|
||||||
for a work that has been modified or installed by the recipient, or for
|
|
||||||
the User Product in which it has been modified or installed. Access to a
|
|
||||||
network may be denied when the modification itself materially and
|
|
||||||
adversely affects the operation of the network or violates the rules and
|
|
||||||
protocols for communication across the network.
|
|
||||||
|
|
||||||
Corresponding Source conveyed, and Installation Information provided,
|
|
||||||
in accord with this section must be in a format that is publicly
|
|
||||||
documented (and with an implementation available to the public in
|
|
||||||
source code form), and must require no special password or key for
|
|
||||||
unpacking, reading or copying.
|
|
||||||
|
|
||||||
7. Additional Terms.
|
|
||||||
|
|
||||||
"Additional permissions" are terms that supplement the terms of this
|
|
||||||
License by making exceptions from one or more of its conditions.
|
|
||||||
Additional permissions that are applicable to the entire Program shall
|
|
||||||
be treated as though they were included in this License, to the extent
|
|
||||||
that they are valid under applicable law. If additional permissions
|
|
||||||
apply only to part of the Program, that part may be used separately
|
|
||||||
under those permissions, but the entire Program remains governed by
|
|
||||||
this License without regard to the additional permissions.
|
|
||||||
|
|
||||||
When you convey a copy of a covered work, you may at your option
|
|
||||||
remove any additional permissions from that copy, or from any part of
|
|
||||||
it. (Additional permissions may be written to require their own
|
|
||||||
removal in certain cases when you modify the work.) You may place
|
|
||||||
additional permissions on material, added by you to a covered work,
|
|
||||||
for which you have or can give appropriate copyright permission.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, for material you
|
|
||||||
add to a covered work, you may (if authorized by the copyright holders of
|
|
||||||
that material) supplement the terms of this License with terms:
|
|
||||||
|
|
||||||
a) Disclaiming warranty or limiting liability differently from the
|
|
||||||
terms of sections 15 and 16 of this License; or
|
|
||||||
|
|
||||||
b) Requiring preservation of specified reasonable legal notices or
|
|
||||||
author attributions in that material or in the Appropriate Legal
|
|
||||||
Notices displayed by works containing it; or
|
|
||||||
|
|
||||||
c) Prohibiting misrepresentation of the origin of that material, or
|
|
||||||
requiring that modified versions of such material be marked in
|
|
||||||
reasonable ways as different from the original version; or
|
|
||||||
|
|
||||||
d) Limiting the use for publicity purposes of names of licensors or
|
|
||||||
authors of the material; or
|
|
||||||
|
|
||||||
e) Declining to grant rights under trademark law for use of some
|
|
||||||
trade names, trademarks, or service marks; or
|
|
||||||
|
|
||||||
f) Requiring indemnification of licensors and authors of that
|
|
||||||
material by anyone who conveys the material (or modified versions of
|
|
||||||
it) with contractual assumptions of liability to the recipient, for
|
|
||||||
any liability that these contractual assumptions directly impose on
|
|
||||||
those licensors and authors.
|
|
||||||
|
|
||||||
All other non-permissive additional terms are considered "further
|
|
||||||
restrictions" within the meaning of section 10. If the Program as you
|
|
||||||
received it, or any part of it, contains a notice stating that it is
|
|
||||||
governed by this License along with a term that is a further
|
|
||||||
restriction, you may remove that term. If a license document contains
|
|
||||||
a further restriction but permits relicensing or conveying under this
|
|
||||||
License, you may add to a covered work material governed by the terms
|
|
||||||
of that license document, provided that the further restriction does
|
|
||||||
not survive such relicensing or conveying.
|
|
||||||
|
|
||||||
If you add terms to a covered work in accord with this section, you
|
|
||||||
must place, in the relevant source files, a statement of the
|
|
||||||
additional terms that apply to those files, or a notice indicating
|
|
||||||
where to find the applicable terms.
|
|
||||||
|
|
||||||
Additional terms, permissive or non-permissive, may be stated in the
|
|
||||||
form of a separately written license, or stated as exceptions;
|
|
||||||
the above requirements apply either way.
|
|
||||||
|
|
||||||
8. Termination.
|
|
||||||
|
|
||||||
You may not propagate or modify a covered work except as expressly
|
|
||||||
provided under this License. Any attempt otherwise to propagate or
|
|
||||||
modify it is void, and will automatically terminate your rights under
|
|
||||||
this License (including any patent licenses granted under the third
|
|
||||||
paragraph of section 11).
|
|
||||||
|
|
||||||
However, if you cease all violation of this License, then your
|
|
||||||
license from a particular copyright holder is reinstated (a)
|
|
||||||
provisionally, unless and until the copyright holder explicitly and
|
|
||||||
finally terminates your license, and (b) permanently, if the copyright
|
|
||||||
holder fails to notify you of the violation by some reasonable means
|
|
||||||
prior to 60 days after the cessation.
|
|
||||||
|
|
||||||
Moreover, your license from a particular copyright holder is
|
|
||||||
reinstated permanently if the copyright holder notifies you of the
|
|
||||||
violation by some reasonable means, this is the first time you have
|
|
||||||
received notice of violation of this License (for any work) from that
|
|
||||||
copyright holder, and you cure the violation prior to 30 days after
|
|
||||||
your receipt of the notice.
|
|
||||||
|
|
||||||
Termination of your rights under this section does not terminate the
|
|
||||||
licenses of parties who have received copies or rights from you under
|
|
||||||
this License. If your rights have been terminated and not permanently
|
|
||||||
reinstated, you do not qualify to receive new licenses for the same
|
|
||||||
material under section 10.
|
|
||||||
|
|
||||||
9. Acceptance Not Required for Having Copies.
|
|
||||||
|
|
||||||
You are not required to accept this License in order to receive or
|
|
||||||
run a copy of the Program. Ancillary propagation of a covered work
|
|
||||||
occurring solely as a consequence of using peer-to-peer transmission
|
|
||||||
to receive a copy likewise does not require acceptance. However,
|
|
||||||
nothing other than this License grants you permission to propagate or
|
|
||||||
modify any covered work. These actions infringe copyright if you do
|
|
||||||
not accept this License. Therefore, by modifying or propagating a
|
|
||||||
covered work, you indicate your acceptance of this License to do so.
|
|
||||||
|
|
||||||
10. Automatic Licensing of Downstream Recipients.
|
|
||||||
|
|
||||||
Each time you convey a covered work, the recipient automatically
|
|
||||||
receives a license from the original licensors, to run, modify and
|
|
||||||
propagate that work, subject to this License. You are not responsible
|
|
||||||
for enforcing compliance by third parties with this License.
|
|
||||||
|
|
||||||
An "entity transaction" is a transaction transferring control of an
|
|
||||||
organization, or substantially all assets of one, or subdividing an
|
|
||||||
organization, or merging organizations. If propagation of a covered
|
|
||||||
work results from an entity transaction, each party to that
|
|
||||||
transaction who receives a copy of the work also receives whatever
|
|
||||||
licenses to the work the party's predecessor in interest had or could
|
|
||||||
give under the previous paragraph, plus a right to possession of the
|
|
||||||
Corresponding Source of the work from the predecessor in interest, if
|
|
||||||
the predecessor has it or can get it with reasonable efforts.
|
|
||||||
|
|
||||||
You may not impose any further restrictions on the exercise of the
|
|
||||||
rights granted or affirmed under this License. For example, you may
|
|
||||||
not impose a license fee, royalty, or other charge for exercise of
|
|
||||||
rights granted under this License, and you may not initiate litigation
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
any patent claim is infringed by making, using, selling, offering for
|
|
||||||
sale, or importing the Program or any portion of it.
|
|
||||||
|
|
||||||
11. Patents.
|
|
||||||
|
|
||||||
A "contributor" is a copyright holder who authorizes use under this
|
|
||||||
License of the Program or a work on which the Program is based. The
|
|
||||||
work thus licensed is called the contributor's "contributor version".
|
|
||||||
|
|
||||||
A contributor's "essential patent claims" are all patent claims
|
|
||||||
owned or controlled by the contributor, whether already acquired or
|
|
||||||
hereafter acquired, that would be infringed by some manner, permitted
|
|
||||||
by this License, of making, using, or selling its contributor version,
|
|
||||||
but do not include claims that would be infringed only as a
|
|
||||||
consequence of further modification of the contributor version. For
|
|
||||||
purposes of this definition, "control" includes the right to grant
|
|
||||||
patent sublicenses in a manner consistent with the requirements of
|
|
||||||
this License.
|
|
||||||
|
|
||||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
|
||||||
patent license under the contributor's essential patent claims, to
|
|
||||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
|
||||||
propagate the contents of its contributor version.
|
|
||||||
|
|
||||||
In the following three paragraphs, a "patent license" is any express
|
|
||||||
agreement or commitment, however denominated, not to enforce a patent
|
|
||||||
(such as an express permission to practice a patent or covenant not to
|
|
||||||
sue for patent infringement). To "grant" such a patent license to a
|
|
||||||
party means to make such an agreement or commitment not to enforce a
|
|
||||||
patent against the party.
|
|
||||||
|
|
||||||
If you convey a covered work, knowingly relying on a patent license,
|
|
||||||
and the Corresponding Source of the work is not available for anyone
|
|
||||||
to copy, free of charge and under the terms of this License, through a
|
|
||||||
publicly available network server or other readily accessible means,
|
|
||||||
then you must either (1) cause the Corresponding Source to be so
|
|
||||||
available, or (2) arrange to deprive yourself of the benefit of the
|
|
||||||
patent license for this particular work, or (3) arrange, in a manner
|
|
||||||
consistent with the requirements of this License, to extend the patent
|
|
||||||
license to downstream recipients. "Knowingly relying" means you have
|
|
||||||
actual knowledge that, but for the patent license, your conveying the
|
|
||||||
covered work in a country, or your recipient's use of the covered work
|
|
||||||
in a country, would infringe one or more identifiable patents in that
|
|
||||||
country that you have reason to believe are valid.
|
|
||||||
|
|
||||||
If, pursuant to or in connection with a single transaction or
|
|
||||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
|
||||||
covered work, and grant a patent license to some of the parties
|
|
||||||
receiving the covered work authorizing them to use, propagate, modify
|
|
||||||
or convey a specific copy of the covered work, then the patent license
|
|
||||||
you grant is automatically extended to all recipients of the covered
|
|
||||||
work and works based on it.
|
|
||||||
|
|
||||||
A patent license is "discriminatory" if it does not include within
|
|
||||||
the scope of its coverage, prohibits the exercise of, or is
|
|
||||||
conditioned on the non-exercise of one or more of the rights that are
|
|
||||||
specifically granted under this License. You may not convey a covered
|
|
||||||
work if you are a party to an arrangement with a third party that is
|
|
||||||
in the business of distributing software, under which you make payment
|
|
||||||
to the third party based on the extent of your activity of conveying
|
|
||||||
the work, and under which the third party grants, to any of the
|
|
||||||
parties who would receive the covered work from you, a discriminatory
|
|
||||||
patent license (a) in connection with copies of the covered work
|
|
||||||
conveyed by you (or copies made from those copies), or (b) primarily
|
|
||||||
for and in connection with specific products or compilations that
|
|
||||||
contain the covered work, unless you entered into that arrangement,
|
|
||||||
or that patent license was granted, prior to 28 March 2007.
|
|
||||||
|
|
||||||
Nothing in this License shall be construed as excluding or limiting
|
|
||||||
any implied license or other defenses to infringement that may
|
|
||||||
otherwise be available to you under applicable patent law.
|
|
||||||
|
|
||||||
12. No Surrender of Others' Freedom.
|
|
||||||
|
|
||||||
If conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot convey a
|
|
||||||
covered work so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you may
|
|
||||||
not convey it at all. For example, if you agree to terms that obligate you
|
|
||||||
to collect a royalty for further conveying from those to whom you convey
|
|
||||||
the Program, the only way you could satisfy both those terms and this
|
|
||||||
License would be to refrain entirely from conveying the Program.
|
|
||||||
|
|
||||||
13. Use with the GNU Affero General Public License.
|
|
||||||
|
|
||||||
Notwithstanding any other provision of this License, you have
|
|
||||||
permission to link or combine any covered work with a work licensed
|
|
||||||
under version 3 of the GNU Affero General Public License into a single
|
|
||||||
combined work, and to convey the resulting work. The terms of this
|
|
||||||
License will continue to apply to the part which is the covered work,
|
|
||||||
but the special requirements of the GNU Affero General Public License,
|
|
||||||
section 13, concerning interaction through a network will apply to the
|
|
||||||
combination as such.
|
|
||||||
|
|
||||||
14. Revised Versions of this License.
|
|
||||||
|
|
||||||
The Free Software Foundation may publish revised and/or new versions of
|
|
||||||
the GNU General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the
|
|
||||||
Program specifies that a certain numbered version of the GNU General
|
|
||||||
Public License "or any later version" applies to it, you have the
|
|
||||||
option of following the terms and conditions either of that numbered
|
|
||||||
version or of any later version published by the Free Software
|
|
||||||
Foundation. If the Program does not specify a version number of the
|
|
||||||
GNU General Public License, you may choose any version ever published
|
|
||||||
by the Free Software Foundation.
|
|
||||||
|
|
||||||
If the Program specifies that a proxy can decide which future
|
|
||||||
versions of the GNU General Public License can be used, that proxy's
|
|
||||||
public statement of acceptance of a version permanently authorizes you
|
|
||||||
to choose that version for the Program.
|
|
||||||
|
|
||||||
Later license versions may give you additional or different
|
|
||||||
permissions. However, no additional obligations are imposed on any
|
|
||||||
author or copyright holder as a result of your choosing to follow a
|
|
||||||
later version.
|
|
||||||
|
|
||||||
15. Disclaimer of Warranty.
|
|
||||||
|
|
||||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
|
||||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
|
||||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
|
||||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
|
||||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
|
||||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
|
||||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
16. Limitation of Liability.
|
|
||||||
|
|
||||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
|
||||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
|
||||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
|
||||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
|
||||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
|
||||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
|
||||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
|
||||||
SUCH DAMAGES.
|
|
||||||
|
|
||||||
17. Interpretation of Sections 15 and 16.
|
|
||||||
|
|
||||||
If the disclaimer of warranty and limitation of liability provided
|
|
||||||
above cannot be given local legal effect according to their terms,
|
|
||||||
reviewing courts shall apply local law that most closely approximates
|
|
||||||
an absolute waiver of all civil liability in connection with the
|
|
||||||
Program, unless a warranty or assumption of liability accompanies a
|
|
||||||
copy of the Program in return for a fee.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
|
||||||
possible use to the public, the best way to achieve this is to make it
|
|
||||||
free software which everyone can redistribute and change under these terms.
|
|
||||||
|
|
||||||
To do so, attach the following notices to the program. It is safest
|
|
||||||
to attach them to the start of each source file to most effectively
|
|
||||||
state the exclusion of warranty; and each file should have at least
|
|
||||||
the "copyright" line and a pointer to where the full notice is found.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
|
||||||
|
|
||||||
If the program does terminal interaction, make it output a short
|
|
||||||
notice like this when it starts in an interactive mode:
|
|
||||||
|
|
||||||
<program> Copyright (C) <year> <name of author>
|
|
||||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
|
||||||
This is free software, and you are welcome to redistribute it
|
|
||||||
under certain conditions; type `show c' for details.
|
|
||||||
|
|
||||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
|
||||||
parts of the General Public License. Of course, your program's commands
|
|
||||||
might be different; for a GUI interface, you would use an "about box".
|
|
||||||
|
|
||||||
You should also get your employer (if you work as a programmer) or school,
|
|
||||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
|
||||||
For more information on this, and how to apply and follow the GNU GPL, see
|
|
||||||
<https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
The GNU General Public License does not permit incorporating your program
|
|
||||||
into proprietary programs. If your program is a subroutine library, you
|
|
||||||
may consider it more useful to permit linking proprietary applications with
|
|
||||||
the library. If this is what you want to do, use the GNU Lesser General
|
|
||||||
Public License instead of this License. But first, please read
|
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
|
36
README.md
@ -3,38 +3,29 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>PiliPala</h1>
|
<h1>PiliPala</h1>
|
||||||
<div align="center">
|
|
||||||
|
|
||||||

|
|
||||||

|
|
||||||

|
|
||||||
</div>
|
|
||||||
<p>使用Flutter开发的BiliBili第三方客户端</p>
|
<p>使用Flutter开发的BiliBili第三方客户端</p>
|
||||||
|
<br/>
|
||||||
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/510shots_so.png" width="32%" alt="home" />
|
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/510shots_so.png" width="32%" alt="home" />
|
||||||
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/174shots_so.png" width="32%" alt="home" />
|
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/174shots_so.png" width="32%" alt="home" />
|
||||||
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/850shots_so.png" width="32%" alt="home" />
|
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/850shots_so.png" width="32%" alt="home" />
|
||||||
<br/>
|
<br/>
|
||||||
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/screenshots/main_screen.png" width="96%" alt="home" />
|
<img src="https://github.com/guozhigq/pilipala/blob/main/assets/sreenshot/main_screen.png" width="96%" alt="home" />
|
||||||
<br/>
|
<br/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## 开发环境
|
## 开发环境
|
||||||
Xcode 13.4 不支持**auto_orientation**,请注释相关代码
|
Xcode 13.4 不支持**auto_orientation**,请注释相关代码
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
[✓] Flutter (Channel stable, 3.16.4, on macOS 14.1.2 23B92 darwin-arm64, locale
|
[✓] Flutter (Channel stable, 3.10.6, on macOS 12.1 21C52 darwin-arm64, locale
|
||||||
zh-Hans-CN)
|
zh-Hans-CN)
|
||||||
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
|
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
|
||||||
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
|
[✓] Xcode - develop for iOS and macOS (Xcode 13.4)
|
||||||
[✓] Chrome - develop for the web
|
[✓] Chrome - develop for the web
|
||||||
[✓] Android Studio (version 2022.3)
|
[✓] Android Studio (version 2022.2)
|
||||||
[✓] VS Code (version 1.85.1)
|
[✓] VS Code (version 1.77.3)
|
||||||
[✓] Connected device (3 available)
|
|
||||||
[✓] Network resources
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -44,7 +35,6 @@ Xcode 13.4 不支持**auto_orientation**,请注释相关代码
|
|||||||
## 技术交流
|
## 技术交流
|
||||||
|
|
||||||
Telegram: https://t.me/+lm_oOVmF0RJiODk1
|
Telegram: https://t.me/+lm_oOVmF0RJiODk1
|
||||||
QQ频道: https://pd.qq.com/s/365esodk3
|
|
||||||
|
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
@ -90,7 +80,7 @@ QQ频道: https://pd.qq.com/s/365esodk3
|
|||||||
- [x] 画质选择(高清画质未解锁)
|
- [x] 画质选择(高清画质未解锁)
|
||||||
- [x] 音质选择(视视频而定)
|
- [x] 音质选择(视视频而定)
|
||||||
- [x] 解码格式选择(视视频而定)
|
- [x] 解码格式选择(视视频而定)
|
||||||
- [x] 弹幕
|
- [ ] 弹幕
|
||||||
- [ ] 字幕
|
- [ ] 字幕
|
||||||
- [x] 记忆播放
|
- [x] 记忆播放
|
||||||
- [x] 视频比例:高度/宽度适应、填充、包含等
|
- [x] 视频比例:高度/宽度适应、填充、包含等
|
||||||
|
@ -58,11 +58,11 @@ android {
|
|||||||
applicationId "com.guozhigq.pilipala"
|
applicationId "com.guozhigq.pilipala"
|
||||||
// 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
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
minSdkVersion 21
|
minSdkVersion 19
|
||||||
multiDexEnabled true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
@ -94,14 +94,3 @@ flutter {
|
|||||||
dependencies {
|
dependencies {
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
|
|
||||||
import com.android.build.OutputFile
|
|
||||||
android.applicationVariants.all { variant ->
|
|
||||||
variant.outputs.each { output ->
|
|
||||||
def abiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
|
|
||||||
if (abiVersionCode != null) {
|
|
||||||
output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.guozhigq.pilipala">
|
package="com.guozhigq.pilipala">
|
||||||
<queries>
|
<queries>
|
||||||
<intent>
|
<intent>
|
||||||
@ -63,13 +64,34 @@
|
|||||||
android:name="io.flutter.embedding.android.NormalTheme"
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
android:resource="@style/NormalTheme"
|
android:resource="@style/NormalTheme"
|
||||||
/>
|
/>
|
||||||
|
<!-- ADD THIS "SERVICE" element -->
|
||||||
|
<service
|
||||||
|
android:name="com.ryanheise.audioservice.AudioService"
|
||||||
|
android:exported="true"
|
||||||
|
android:foregroundServiceType="mediaPlayback"
|
||||||
|
tools:ignore="Instantiatable">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.media.browse.MediaBrowserService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
|
<!-- ADD THIS "RECEIVER" element -->
|
||||||
|
<receiver
|
||||||
|
android:name="com.ryanheise.audioservice.MediaButtonReceiver"
|
||||||
|
android:exported="true"
|
||||||
|
tools:ignore="Instantiatable">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN"/>
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<action android:name="android.intent.action.SEARCH" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="bilibili" android:host="forward" />
|
<data android:scheme="bilibili" android:host="forward" />
|
||||||
@ -223,10 +245,6 @@
|
|||||||
android:pathPattern="/mobile/video/.*" />
|
android:pathPattern="/mobile/video/.*" />
|
||||||
<data android:scheme="https" android:host="www.bilibili.com"
|
<data android:scheme="https" android:host="www.bilibili.com"
|
||||||
android:pathPattern="/mobile/video/.*" />
|
android:pathPattern="/mobile/video/.*" />
|
||||||
<data android:scheme="https" android:host="b23.tv"
|
|
||||||
android:pathPattern="/*" />
|
|
||||||
<data android:scheme="https" android:host="space.bilibili.com"
|
|
||||||
android:pathPattern="/*" />
|
|
||||||
|
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
@ -269,4 +287,8 @@
|
|||||||
-->
|
-->
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK"/>
|
||||||
|
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
|
||||||
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 526 KiB After Width: | Height: | Size: 526 KiB |
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 659 KiB After Width: | Height: | Size: 659 KiB |
Before Width: | Height: | Size: 300 KiB After Width: | Height: | Size: 300 KiB |
Before Width: | Height: | Size: 217 KiB After Width: | Height: | Size: 217 KiB |
Before Width: | Height: | Size: 504 KiB After Width: | Height: | Size: 504 KiB |
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 181 KiB After Width: | Height: | Size: 181 KiB |
Before Width: | Height: | Size: 407 KiB After Width: | Height: | Size: 407 KiB |
Before Width: | Height: | Size: 522 KiB After Width: | Height: | Size: 522 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
@ -1,11 +0,0 @@
|
|||||||
## 1.0.12
|
|
||||||
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ iOS端视频播放时没有声音
|
|
||||||
+ 超过6分钟弹幕不显示
|
|
||||||
+ 视频详情页网络异常
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,22 +0,0 @@
|
|||||||
## 1.0.13
|
|
||||||
|
|
||||||
|
|
||||||
### 新功能
|
|
||||||
+ 视频详情页稍后再看
|
|
||||||
+ 发送弹幕 感谢@orz12
|
|
||||||
+ 消息展示
|
|
||||||
+ up主页显示获赞数
|
|
||||||
+ up主页显示合集
|
|
||||||
+ 视频详情页「ai总结」增加开关
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 首页推荐问题(需要重新登录)
|
|
||||||
+ 长按倍速逻辑
|
|
||||||
+ 视频详情页网络异常
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ 设置面板样式 感谢@GuMengYu @KoolShow
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,28 +0,0 @@
|
|||||||
## 1.0.14
|
|
||||||
|
|
||||||
圣诞节快乐~ 🎉
|
|
||||||
|
|
||||||
大部分内容由@orz12提供,感谢👏
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 全屏弹幕消失
|
|
||||||
+ iOS全屏/退出全屏视频暂停
|
|
||||||
+ 个人主页关注状态
|
|
||||||
+ 视频合集向下滑动UI问题
|
|
||||||
+ 媒体库滑动底栏不隐藏
|
|
||||||
+ 个人主页动态加载问题 * 2
|
|
||||||
+ 未登录状态访问个人主页异常
|
|
||||||
+ 视频搜索标题特殊字符转义
|
|
||||||
+ iOS闪退
|
|
||||||
+ 消息页面夜间模式异常
|
|
||||||
+ 消息页面含有撤回消息时异常
|
|
||||||
+ 弹幕速度
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ 全屏播放方案优化
|
|
||||||
+ 弹幕加载逻辑优化
|
|
||||||
+ 点赞、投币逻辑优化
|
|
||||||
+ 进度条及播放时间渲染优化
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,22 +0,0 @@
|
|||||||
## 1.0.15
|
|
||||||
|
|
||||||
元旦快乐~ 🎉
|
|
||||||
|
|
||||||
### 功能
|
|
||||||
+ 转发动态评论展示
|
|
||||||
+ 推荐、最热、收藏视频增肌日期显示
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 全屏播放相关问题
|
|
||||||
+ 评论区@用户展示问题
|
|
||||||
+ 登录状态闪退问题
|
|
||||||
+ pip意外触发问题
|
|
||||||
+ 动态页tab切换样式问题
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ 首页默认使用web端推荐
|
|
||||||
+ 取消iOS路由切换效果
|
|
||||||
+ 视频分享中添加Up主
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,15 +0,0 @@
|
|||||||
## 1.0.16
|
|
||||||
|
|
||||||
|
|
||||||
### 功能
|
|
||||||
+ toast 背景支持透明度调节
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ web端推荐未展示【已关注】
|
|
||||||
+ up主动态页异常
|
|
||||||
+ 未打开自动播放时,视频详情页异常
|
|
||||||
+ 视频暂停状态取消自动ip
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,39 +0,0 @@
|
|||||||
## 1.0.17
|
|
||||||
|
|
||||||
|
|
||||||
### 功能
|
|
||||||
+ 视频全屏时隐藏进度条
|
|
||||||
+ 动态内容增加投稿跳转
|
|
||||||
+ 未开启自动播放时点击封面播放
|
|
||||||
+ 弹幕发送标识
|
|
||||||
+ 定时关闭
|
|
||||||
+ 推荐视频卡片拉黑up功能
|
|
||||||
+ 首页tabbar编辑排序
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 连续跳转搜索页未刷新
|
|
||||||
+ 搜索结果为空时页面异常
|
|
||||||
+ 评论区链接解析
|
|
||||||
+ 视频全屏状态栏背景色
|
|
||||||
+ 私信对话气泡位置
|
|
||||||
+ 设置up关注分组样式
|
|
||||||
+ 每次推荐请求数据相同
|
|
||||||
+ iOS代理网络异常
|
|
||||||
+ 双击切换播放状态无声
|
|
||||||
+ 设置自定义倍速白屏
|
|
||||||
+ 免登录查看1080p
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ 首页web端推荐观看数展示
|
|
||||||
+ 首页web端推荐接口更新
|
|
||||||
+ 首页样式
|
|
||||||
+ 搜索页跳转
|
|
||||||
+ 弹幕资源优化
|
|
||||||
+ 图片渲染占用内存优化(部分)
|
|
||||||
+ 两次返回退出应用
|
|
||||||
+ schame 补充
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,16 +0,0 @@
|
|||||||
## 1.0.18
|
|
||||||
|
|
||||||
|
|
||||||
### 功能
|
|
||||||
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,15 +0,0 @@
|
|||||||
## 1.0.19
|
|
||||||
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 视频404、评论加载错误
|
|
||||||
+ bvav转换
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ 视频详情页内存占用
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,31 +0,0 @@
|
|||||||
## 1.0.20
|
|
||||||
|
|
||||||
|
|
||||||
### 功能
|
|
||||||
+ 评论区增加表情
|
|
||||||
+ 首页渐变背景开关
|
|
||||||
+ 媒体库显示「我的订阅」
|
|
||||||
+ 评论区链接解析
|
|
||||||
+ 默认启动页设置
|
|
||||||
|
|
||||||
### 修复
|
|
||||||
+ 评论区内容重复
|
|
||||||
+ pip相关问题
|
|
||||||
+ 播放多p视频评论不刷新
|
|
||||||
+ 视频评论翻页重复
|
|
||||||
|
|
||||||
### 优化
|
|
||||||
+ url scheme优化
|
|
||||||
+ 图片预览放大
|
|
||||||
+ 图片加载速度
|
|
||||||
+ 视频评论区复制
|
|
||||||
+ 全屏显示视频标题
|
|
||||||
+ 网络异常处理
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
更多更新日志可在Github上查看
|
|
||||||
问题反馈、功能建议请查看「关于」页面。
|
|
@ -1,9 +0,0 @@
|
|||||||
PiliPala is a third-party Bilibili client developed in Flutter.
|
|
||||||
|
|
||||||
Top Features:
|
|
||||||
|
|
||||||
* List of recommended videos
|
|
||||||
* List of hottest videos
|
|
||||||
* Popular live streams
|
|
||||||
* List of bangumis
|
|
||||||
* Block videos from blacklisted users
|
|
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 526 KiB |
Before Width: | Height: | Size: 1.1 MiB |
@ -1 +0,0 @@
|
|||||||
A third-party Bilibili client developed in Flutter
|
|
@ -1 +0,0 @@
|
|||||||
PiliPala
|
|
@ -1,21 +0,0 @@
|
|||||||
修复
|
|
||||||
|
|
||||||
* 全屏弹幕消失
|
|
||||||
* iOS 全屏/退出全屏视频暂停
|
|
||||||
* 个人主页关注状态
|
|
||||||
* 视频合集向下滑动UI问题
|
|
||||||
* 媒体库滑动底栏不隐藏
|
|
||||||
* 个人主页动态加载问题 * 2
|
|
||||||
* 未登录状态访问个人主页异常
|
|
||||||
* 视频搜索标题特殊字符转义
|
|
||||||
* iOS 闪退
|
|
||||||
* 消息页面夜间模式异常
|
|
||||||
* 消息页面含有撤回消息时异常
|
|
||||||
* 弹幕速度
|
|
||||||
|
|
||||||
优化
|
|
||||||
|
|
||||||
* 全屏播放方案优化
|
|
||||||
* 弹幕加载逻辑优化
|
|
||||||
* 点赞、投币逻辑优化
|
|
||||||
* 进度条及播放时间渲染优化
|
|
@ -1,9 +0,0 @@
|
|||||||
PiliPala 是使用 Flutter 开发的 BiliBili 第三方客户端。
|
|
||||||
|
|
||||||
主要功能:
|
|
||||||
|
|
||||||
* 推荐视频列表 (app 端)
|
|
||||||
* 最热视频列表
|
|
||||||
* 热门直播
|
|
||||||
* 番剧列表
|
|
||||||
* 屏蔽黑名单内用户视频
|
|
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 526 KiB |
Before Width: | Height: | Size: 1.1 MiB |
@ -1 +0,0 @@
|
|||||||
使用 Flutter 开发的 BiliBili 第三方客户端
|
|
@ -1 +0,0 @@
|
|||||||
PiliPala
|
|
@ -38,10 +38,10 @@ post_install do |installer|
|
|||||||
installer.pods_project.targets.each do |target|
|
installer.pods_project.targets.each do |target|
|
||||||
flutter_additional_ios_build_settings(target)
|
flutter_additional_ios_build_settings(target)
|
||||||
target.build_configurations.each do |config|
|
target.build_configurations.each do |config|
|
||||||
deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET']
|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
|
||||||
if !deployment_target.nil? && !deployment_target.empty? && deployment_target.to_f < 12.0
|
'$(inherited)',
|
||||||
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
|
'AUDIO_SESSION_MICROPHONE=0'
|
||||||
end
|
]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,28 +5,26 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- audio_session (0.0.1):
|
- audio_session (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- auto_orientation (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- connectivity_plus (0.0.1):
|
- connectivity_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- ReachabilitySwift
|
- ReachabilitySwift
|
||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
- flutter_mailer (0.0.1):
|
|
||||||
- Flutter
|
|
||||||
- flutter_volume_controller (0.0.1):
|
- flutter_volume_controller (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- fluttertoast (0.0.2):
|
|
||||||
- Flutter
|
|
||||||
- Toast
|
|
||||||
- FMDB (2.7.5):
|
- FMDB (2.7.5):
|
||||||
- FMDB/standard (= 2.7.5)
|
- FMDB/standard (= 2.7.5)
|
||||||
- FMDB/standard (2.7.5)
|
- FMDB/standard (2.7.5)
|
||||||
- gt3_flutter_plugin (0.0.8):
|
- gt3_flutter_plugin (0.0.8):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
<<<<<<< HEAD
|
||||||
|
- just_audio (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
=======
|
||||||
- GT3Captcha-iOS
|
- GT3Captcha-iOS
|
||||||
- GT3Captcha-iOS (0.15.8.3)
|
- GT3Captcha-iOS (0.15.8.3)
|
||||||
|
>>>>>>> main
|
||||||
- media_kit_libs_ios_video (1.0.4):
|
- media_kit_libs_ios_video (1.0.4):
|
||||||
- Flutter
|
- Flutter
|
||||||
- media_kit_native_event_loop (1.0.0):
|
- media_kit_native_event_loop (1.0.0):
|
||||||
@ -54,7 +52,6 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- system_proxy (0.0.1):
|
- system_proxy (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Toast (4.1.0)
|
|
||||||
- url_launcher_ios (0.0.1):
|
- url_launcher_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- volume_controller (0.0.1):
|
- volume_controller (0.0.1):
|
||||||
@ -70,14 +67,16 @@ DEPENDENCIES:
|
|||||||
- appscheme (from `.symlinks/plugins/appscheme/ios`)
|
- appscheme (from `.symlinks/plugins/appscheme/ios`)
|
||||||
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
- audio_service (from `.symlinks/plugins/audio_service/ios`)
|
||||||
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
- audio_session (from `.symlinks/plugins/audio_session/ios`)
|
||||||
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
|
|
||||||
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_mailer (from `.symlinks/plugins/flutter_mailer/ios`)
|
|
||||||
- flutter_volume_controller (from `.symlinks/plugins/flutter_volume_controller/ios`)
|
- flutter_volume_controller (from `.symlinks/plugins/flutter_volume_controller/ios`)
|
||||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
<<<<<<< HEAD
|
||||||
|
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
|
||||||
|
- just_audio (from `.symlinks/plugins/just_audio/ios`)
|
||||||
|
=======
|
||||||
- gt3_flutter_plugin (from `.symlinks/plugins/gt3_flutter_plugin/ios`)
|
- gt3_flutter_plugin (from `.symlinks/plugins/gt3_flutter_plugin/ios`)
|
||||||
|
>>>>>>> main
|
||||||
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
- media_kit_libs_ios_video (from `.symlinks/plugins/media_kit_libs_ios_video/ios`)
|
||||||
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
|
- media_kit_native_event_loop (from `.symlinks/plugins/media_kit_native_event_loop/ios`)
|
||||||
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
- media_kit_video (from `.symlinks/plugins/media_kit_video/ios`)
|
||||||
@ -101,7 +100,6 @@ SPEC REPOS:
|
|||||||
- FMDB
|
- FMDB
|
||||||
- GT3Captcha-iOS
|
- GT3Captcha-iOS
|
||||||
- ReachabilitySwift
|
- ReachabilitySwift
|
||||||
- Toast
|
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
appscheme:
|
appscheme:
|
||||||
@ -110,22 +108,23 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/audio_service/ios"
|
:path: ".symlinks/plugins/audio_service/ios"
|
||||||
audio_session:
|
audio_session:
|
||||||
:path: ".symlinks/plugins/audio_session/ios"
|
:path: ".symlinks/plugins/audio_session/ios"
|
||||||
auto_orientation:
|
|
||||||
:path: ".symlinks/plugins/auto_orientation/ios"
|
|
||||||
connectivity_plus:
|
connectivity_plus:
|
||||||
:path: ".symlinks/plugins/connectivity_plus/ios"
|
:path: ".symlinks/plugins/connectivity_plus/ios"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
:path: Flutter
|
:path: Flutter
|
||||||
flutter_mailer:
|
|
||||||
:path: ".symlinks/plugins/flutter_mailer/ios"
|
|
||||||
flutter_volume_controller:
|
flutter_volume_controller:
|
||||||
:path: ".symlinks/plugins/flutter_volume_controller/ios"
|
:path: ".symlinks/plugins/flutter_volume_controller/ios"
|
||||||
fluttertoast:
|
<<<<<<< HEAD
|
||||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
image_gallery_saver:
|
||||||
|
:path: ".symlinks/plugins/image_gallery_saver/ios"
|
||||||
|
just_audio:
|
||||||
|
:path: ".symlinks/plugins/just_audio/ios"
|
||||||
|
=======
|
||||||
gt3_flutter_plugin:
|
gt3_flutter_plugin:
|
||||||
:path: ".symlinks/plugins/gt3_flutter_plugin/ios"
|
:path: ".symlinks/plugins/gt3_flutter_plugin/ios"
|
||||||
|
>>>>>>> main
|
||||||
media_kit_libs_ios_video:
|
media_kit_libs_ios_video:
|
||||||
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
|
:path: ".symlinks/plugins/media_kit_libs_ios_video/ios"
|
||||||
media_kit_native_event_loop:
|
media_kit_native_event_loop:
|
||||||
@ -165,36 +164,37 @@ SPEC CHECKSUMS:
|
|||||||
appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8
|
appscheme: b1c3f8862331cb20430cf9e0e4af85dbc1572ad8
|
||||||
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
|
||||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
|
||||||
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
|
connectivity_plus: 07c49e96d7fc92bc9920617b83238c4d178b446a
|
||||||
device_info_plus: c6fb39579d0f423935b0c9ce7ee2f44b71b9fce6
|
device_info_plus: 7545d84d8d1b896cb16a4ff98c19f07ec4b298ea
|
||||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
flutter_mailer: 2ef5a67087bc8c6c4cefd04a178bf1ae2c94cd83
|
|
||||||
flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529
|
flutter_volume_controller: e4d5832f08008180f76e30faf671ffd5a425e529
|
||||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
|
||||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||||
|
<<<<<<< HEAD
|
||||||
|
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||||
|
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
|
||||||
|
=======
|
||||||
gt3_flutter_plugin: bfa1f26e9a09dc00401514be5ed437f964cabf23
|
gt3_flutter_plugin: bfa1f26e9a09dc00401514be5ed437f964cabf23
|
||||||
GT3Captcha-iOS: 5e3b1077834d8a9d6f4d64a447a30af3e14affe6
|
GT3Captcha-iOS: 5e3b1077834d8a9d6f4d64a447a30af3e14affe6
|
||||||
|
>>>>>>> main
|
||||||
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
|
media_kit_libs_ios_video: a5fe24bc7875ccd6378a0978c13185e1344651c1
|
||||||
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
|
media_kit_native_event_loop: e6b2ab20cf0746eb1c33be961fcf79667304fa2a
|
||||||
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
|
media_kit_video: 5da63f157170e5bf303bf85453b7ef6971218a2e
|
||||||
package_info_plus: 115f4ad11e0698c8c1c5d8a689390df880f47e85
|
package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7
|
||||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||||
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||||
saver_gallery: 2b4e584106fde2407ab51560f3851564963e6b78
|
saver_gallery: 2b4e584106fde2407ab51560f3851564963e6b78
|
||||||
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
|
screen_brightness_ios: 715ca807df953bf676d339f11464e438143ee625
|
||||||
share_plus: c3fef564749587fc939ef86ffb283ceac0baf9f5
|
share_plus: 599aa54e4ea31d4b4c0e9c911bcc26c55e791028
|
||||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||||
status_bar_control: 7c84146799e6a076315cc1550f78ef53aae3e446
|
status_bar_control: 7c84146799e6a076315cc1550f78ef53aae3e446
|
||||||
system_proxy: bec1a5c5af67dd3e3ebf43979400a8756c04cc44
|
system_proxy: bec1a5c5af67dd3e3ebf43979400a8756c04cc44
|
||||||
Toast: ec33c32b8688982cecc6348adeae667c1b9938da
|
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||||
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
|
|
||||||
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
|
volume_controller: 531ddf792994285c9b17f9d8a7e4dcdd29b3eae9
|
||||||
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
|
wakelock_plus: 8b09852c8876491e4b6d179e17dfe2a0b5f60d47
|
||||||
webview_cookie_manager: eaf920722b493bd0f7611b5484771ca53fed03f7
|
webview_cookie_manager: eaf920722b493bd0f7611b5484771ca53fed03f7
|
||||||
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
|
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
|
||||||
|
|
||||||
PODFILE CHECKSUM: 637cd290bed23275b5f5ffcc7eb1e73d0a5fb2be
|
PODFILE CHECKSUM: fc8a34c4ba2e14d31df90bf03cf419a764f2778c
|
||||||
|
|
||||||
COCOAPODS: 1.14.3
|
COCOAPODS: 1.12.1
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
3DA6FBBC55FDD1E3261D6D67 /* Pods-Runner.release.xcconfig */,
|
3DA6FBBC55FDD1E3261D6D67 /* Pods-Runner.release.xcconfig */,
|
||||||
32E2926120A1A8DC0E629BC6 /* Pods-Runner.profile.xcconfig */,
|
32E2926120A1A8DC0E629BC6 /* Pods-Runner.profile.xcconfig */,
|
||||||
);
|
);
|
||||||
|
name = Pods;
|
||||||
path = Pods;
|
path = Pods;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
};
|
};
|
||||||
@ -156,7 +157,7 @@
|
|||||||
97C146E61CF9000F007C117D /* Project object */ = {
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 1430;
|
LastUpgradeCheck = 1300;
|
||||||
ORGANIZATIONNAME = "";
|
ORGANIZATIONNAME = "";
|
||||||
TargetAttributes = {
|
TargetAttributes = {
|
||||||
97C146ED1CF9000F007C117D = {
|
97C146ED1CF9000F007C117D = {
|
||||||
@ -360,7 +361,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
@ -376,7 +377,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = RN352BA826;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@ -438,7 +439,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = YES;
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
@ -487,7 +488,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
MTL_ENABLE_DEBUG_INFO = NO;
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SUPPORTED_PLATFORMS = iphoneos;
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
@ -505,7 +506,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = RN352BA826;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
@ -528,7 +529,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = RN352BA826;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Scheme
|
<Scheme
|
||||||
LastUpgradeVersion = "1430"
|
LastUpgradeVersion = "1300"
|
||||||
version = "1.3">
|
version = "1.3">
|
||||||
<BuildAction
|
<BuildAction
|
||||||
parallelizeBuildables = "YES"
|
parallelizeBuildables = "YES"
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="iOS"/>
|
<deployment identifier="iOS"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
<!--Flutter View Controller-->
|
<!--Flutter View Controller-->
|
||||||
@ -16,14 +14,13 @@
|
|||||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
</layoutGuides>
|
</layoutGuides>
|
||||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
</view>
|
</view>
|
||||||
</viewController>
|
</viewController>
|
||||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="-11" y="-41"/>
|
|
||||||
</scene>
|
</scene>
|
||||||
</scenes>
|
</scenes>
|
||||||
</document>
|
</document>
|
||||||
|
@ -103,6 +103,10 @@
|
|||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
|
<<<<<<< HEAD
|
||||||
|
<!-- audio service配置 -->
|
||||||
|
=======
|
||||||
|
>>>>>>> main
|
||||||
<key>UIBackgroundModes</key>
|
<key>UIBackgroundModes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>audio</string>
|
<string>audio</string>
|
||||||
|
@ -9,11 +9,7 @@ class StyleString {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Constants {
|
class Constants {
|
||||||
// 27eb53fc9058f8c3 移动端 Android
|
static const String appKey = '27eb53fc9058f8c3';
|
||||||
// 4409e2ce8ffd12b8 TV端
|
|
||||||
static const String appKey = '4409e2ce8ffd12b8';
|
|
||||||
// 59b43e04ad6965f34319062b478f83dd TV端
|
|
||||||
static const String appSec = '59b43e04ad6965f34319062b478f83dd';
|
|
||||||
static const String thirdSign = '04224646d1fea004e79606d3b038c84a';
|
static const String thirdSign = '04224646d1fea004e79606d3b038c84a';
|
||||||
static const String thirdApi =
|
static const String thirdApi =
|
||||||
'https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png';
|
'https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png';
|
||||||
|
@ -1,5 +1,37 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// Widget pBadge(
|
||||||
|
// text,
|
||||||
|
// context,
|
||||||
|
// double? top,
|
||||||
|
// double? right,
|
||||||
|
// double? bottom,
|
||||||
|
// double? left, {
|
||||||
|
// type = 'primary',
|
||||||
|
// }) {
|
||||||
|
// Color bgColor = Theme.of(context).colorScheme.primary;
|
||||||
|
// Color color = Theme.of(context).colorScheme.onPrimary;
|
||||||
|
// if (type == 'gray') {
|
||||||
|
// bgColor = Colors.black54.withOpacity(0.4);
|
||||||
|
// color = Colors.white;
|
||||||
|
// }
|
||||||
|
// return Positioned(
|
||||||
|
// top: top,
|
||||||
|
// left: left,
|
||||||
|
// right: right,
|
||||||
|
// bottom: bottom,
|
||||||
|
// child: Container(
|
||||||
|
// padding: const EdgeInsets.symmetric(vertical: 1, horizontal: 6),
|
||||||
|
// decoration:
|
||||||
|
// BoxDecoration(borderRadius: BorderRadius.circular(4), color: bgColor),
|
||||||
|
// child: Text(
|
||||||
|
// text,
|
||||||
|
// style: TextStyle(fontSize: 11, color: color),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
class PBadge extends StatelessWidget {
|
class PBadge extends StatelessWidget {
|
||||||
final String? text;
|
final String? text;
|
||||||
final double? top;
|
final double? top;
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class ContentContainer extends StatelessWidget {
|
|
||||||
final Widget? contentWidget;
|
|
||||||
final Widget? bottomWidget;
|
|
||||||
final bool isScrollable;
|
|
||||||
final Clip? childClipBehavior;
|
|
||||||
|
|
||||||
const ContentContainer(
|
|
||||||
{Key? key,
|
|
||||||
this.contentWidget,
|
|
||||||
this.bottomWidget,
|
|
||||||
this.isScrollable = true,
|
|
||||||
this.childClipBehavior})
|
|
||||||
: super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return LayoutBuilder(
|
|
||||||
builder: (BuildContext context, BoxConstraints constraints) {
|
|
||||||
return SingleChildScrollView(
|
|
||||||
clipBehavior: childClipBehavior ?? Clip.hardEdge,
|
|
||||||
physics: isScrollable ? null : const NeverScrollableScrollPhysics(),
|
|
||||||
child: ConstrainedBox(
|
|
||||||
constraints: constraints.copyWith(
|
|
||||||
minHeight: constraints.maxHeight,
|
|
||||||
maxHeight: double.infinity,
|
|
||||||
),
|
|
||||||
child: IntrinsicHeight(
|
|
||||||
child: Column(
|
|
||||||
children: <Widget>[
|
|
||||||
if (contentWidget != null)
|
|
||||||
Expanded(
|
|
||||||
child: contentWidget!,
|
|
||||||
)
|
|
||||||
else
|
|
||||||
const Spacer(),
|
|
||||||
if (bottomWidget != null) bottomWidget!,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,27 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hive/hive.dart';
|
|
||||||
import 'package:pilipala/utils/storage.dart';
|
|
||||||
|
|
||||||
Box<dynamic> setting = GStrorage.setting;
|
|
||||||
|
|
||||||
class CustomToast extends StatelessWidget {
|
class CustomToast extends StatelessWidget {
|
||||||
const CustomToast({super.key, required this.msg});
|
|
||||||
|
|
||||||
final String msg;
|
final String msg;
|
||||||
|
const CustomToast({Key? key, required this.msg}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final double toastOpacity =
|
|
||||||
setting.get(SettingBoxKey.defaultToastOp, defaultValue: 1.0) as double;
|
|
||||||
return Container(
|
return Container(
|
||||||
margin:
|
margin:
|
||||||
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30),
|
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom + 30),
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context).colorScheme.primaryContainer,
|
||||||
.colorScheme
|
|
||||||
.primaryContainer
|
|
||||||
.withOpacity(toastOpacity),
|
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
|
@ -1,46 +1,45 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_html/flutter_html.dart';
|
import 'package:flutter_html/flutter_html.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'network_img_layer.dart';
|
|
||||||
|
|
||||||
// ignore: must_be_immutable
|
// ignore: must_be_immutable
|
||||||
class HtmlRender extends StatelessWidget {
|
class HtmlRender extends StatelessWidget {
|
||||||
const HtmlRender({
|
String? htmlContent;
|
||||||
|
final int? imgCount;
|
||||||
|
final List? imgList;
|
||||||
|
|
||||||
|
HtmlRender({
|
||||||
this.htmlContent,
|
this.htmlContent,
|
||||||
this.imgCount,
|
this.imgCount,
|
||||||
this.imgList,
|
this.imgList,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
final String? htmlContent;
|
|
||||||
final int? imgCount;
|
|
||||||
final List<String>? imgList;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Html(
|
return Html(
|
||||||
data: htmlContent,
|
data: htmlContent,
|
||||||
onLinkTap: (String? url, Map<String, String> buildContext, attributes) {},
|
onLinkTap: (url, buildContext, attributes) => {},
|
||||||
extensions: [
|
extensions: [
|
||||||
TagExtension(
|
TagExtension(
|
||||||
tagsToExtend: <String>{'img'},
|
tagsToExtend: {"img"},
|
||||||
builder: (ExtensionContext extensionContext) {
|
builder: (extensionContext) {
|
||||||
try {
|
try {
|
||||||
final Map<String, dynamic> attributes =
|
Map attributes = extensionContext.attributes;
|
||||||
extensionContext.attributes;
|
List key = attributes.keys.toList();
|
||||||
final List<dynamic> key = attributes.keys.toList();
|
String? imgUrl = key.contains('src')
|
||||||
String imgUrl = key.contains('src')
|
? attributes['src']
|
||||||
? attributes['src'] as String
|
: attributes['data-src'];
|
||||||
: attributes['data-src'] as String;
|
if (imgUrl!.startsWith('//')) {
|
||||||
if (imgUrl.startsWith('//')) {
|
|
||||||
imgUrl = 'https:$imgUrl';
|
imgUrl = 'https:$imgUrl';
|
||||||
}
|
}
|
||||||
if (imgUrl.startsWith('http://')) {
|
if (imgUrl.startsWith('http://')) {
|
||||||
imgUrl = imgUrl.replaceAll('http://', 'https://');
|
imgUrl = imgUrl.replaceAll('http://', 'https://');
|
||||||
}
|
}
|
||||||
imgUrl = imgUrl.contains('@') ? imgUrl.split('@').first : imgUrl;
|
imgUrl = imgUrl.contains('@') ? imgUrl.split('@').first : imgUrl;
|
||||||
final bool isEmote = imgUrl.contains('/emote/');
|
bool isEmote = imgUrl.contains('/emote/');
|
||||||
final bool isMall = imgUrl.contains('/mall/');
|
bool isMall = imgUrl.contains('/mall/');
|
||||||
if (isMall) {
|
if (isMall) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
@ -59,37 +58,38 @@ class HtmlRender extends StatelessWidget {
|
|||||||
src: imgUrl,
|
src: imgUrl,
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
print(err);
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
style: {
|
style: {
|
||||||
'html': Style(
|
"html": Style(
|
||||||
fontSize: FontSize.medium,
|
fontSize: FontSize.medium,
|
||||||
lineHeight: LineHeight.percent(140),
|
lineHeight: LineHeight.percent(140),
|
||||||
),
|
),
|
||||||
'body': Style(margin: Margins.zero, padding: HtmlPaddings.zero),
|
"body": Style(margin: Margins.zero, padding: HtmlPaddings.zero),
|
||||||
'a': Style(
|
"a": Style(
|
||||||
color: Theme.of(context).colorScheme.primary,
|
color: Theme.of(context).colorScheme.primary,
|
||||||
textDecoration: TextDecoration.none,
|
textDecoration: TextDecoration.none,
|
||||||
),
|
),
|
||||||
'p': Style(
|
"p": Style(
|
||||||
margin: Margins.only(bottom: 10),
|
margin: Margins.only(bottom: 10),
|
||||||
),
|
),
|
||||||
'span': Style(
|
"span": Style(
|
||||||
fontSize: FontSize.medium,
|
fontSize: FontSize.medium,
|
||||||
height: Height(1.65),
|
height: Height(1.65),
|
||||||
),
|
),
|
||||||
'div': Style(height: Height.auto()),
|
"div": Style(height: Height.auto()),
|
||||||
'li > p': Style(
|
"li > p": Style(
|
||||||
display: Display.inline,
|
display: Display.inline,
|
||||||
),
|
),
|
||||||
'li': Style(
|
"li": Style(
|
||||||
padding: HtmlPaddings.only(bottom: 4),
|
padding: HtmlPaddings.only(bottom: 4),
|
||||||
textAlign: TextAlign.justify,
|
textAlign: TextAlign.justify,
|
||||||
),
|
),
|
||||||
'img': Style(margin: Margins.only(top: 4, bottom: 4)),
|
"img": Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -22,27 +22,20 @@ class HttpError extends StatelessWidget {
|
|||||||
"assets/images/error.svg",
|
"assets/images/error.svg",
|
||||||
height: 200,
|
height: 200,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 30),
|
const SizedBox(height: 20),
|
||||||
Text(
|
Text(
|
||||||
errMsg ?? '请求异常',
|
errMsg ?? '请求异常',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: Theme.of(context).textTheme.titleSmall,
|
style: Theme.of(context).textTheme.titleSmall,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 30),
|
||||||
FilledButton.tonal(
|
OutlinedButton.icon(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
fn!();
|
fn!();
|
||||||
},
|
},
|
||||||
style: ButtonStyle(
|
icon: const Icon(Icons.arrow_forward_outlined, size: 20),
|
||||||
backgroundColor: MaterialStateProperty.resolveWith((states) {
|
label: Text(btnText ?? '点击重试'),
|
||||||
return Theme.of(context).colorScheme.primary.withAlpha(20);
|
)
|
||||||
}),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
btnText ?? '点击重试',
|
|
||||||
style: TextStyle(color: Theme.of(context).colorScheme.primary),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../utils/utils.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import '../constants.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'network_img_layer.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
|
|
||||||
class LiveCard extends StatelessWidget {
|
class LiveCard extends StatelessWidget {
|
||||||
// ignore: prefer_typing_uninitialized_variables
|
// ignore: prefer_typing_uninitialized_variables
|
||||||
final dynamic liveItem;
|
final liveItem;
|
||||||
|
|
||||||
const LiveCard({
|
const LiveCard({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -14,7 +14,7 @@ class LiveCard extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final String heroTag = Utils.makeHeroTag(liveItem.roomid);
|
String heroTag = Utils.makeHeroTag(liveItem.roomid);
|
||||||
|
|
||||||
return Card(
|
return Card(
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
@ -23,6 +23,7 @@ class LiveCard extends StatelessWidget {
|
|||||||
borderRadius: BorderRadius.circular(0),
|
borderRadius: BorderRadius.circular(0),
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: Theme.of(context).dividerColor.withOpacity(0.08),
|
color: Theme.of(context).dividerColor.withOpacity(0.08),
|
||||||
|
width: 1,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.zero,
|
margin: EdgeInsets.zero,
|
||||||
@ -32,16 +33,15 @@ class LiveCard extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
AspectRatio(
|
AspectRatio(
|
||||||
aspectRatio: StyleString.aspectRatio,
|
aspectRatio: StyleString.aspectRatio,
|
||||||
child: LayoutBuilder(builder:
|
child: LayoutBuilder(builder: (context, boxConstraints) {
|
||||||
(BuildContext context, BoxConstraints boxConstraints) {
|
double maxWidth = boxConstraints.maxWidth;
|
||||||
final double maxWidth = boxConstraints.maxWidth;
|
double maxHeight = boxConstraints.maxHeight;
|
||||||
final double maxHeight = boxConstraints.maxHeight;
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Hero(
|
Hero(
|
||||||
tag: heroTag,
|
tag: heroTag,
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: liveItem.cover as String,
|
src: liveItem.cover,
|
||||||
type: 'emote',
|
type: 'emote',
|
||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
@ -58,7 +58,7 @@ class LiveCard extends StatelessWidget {
|
|||||||
// view: liveItem.stat.view,
|
// view: liveItem.stat.view,
|
||||||
// danmaku: liveItem.stat.danmaku,
|
// danmaku: liveItem.stat.danmaku,
|
||||||
// duration: liveItem.duration,
|
// duration: liveItem.duration,
|
||||||
online: liveItem.online as int,
|
online: liveItem.online,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -90,7 +90,7 @@ class LiveContent extends StatelessWidget {
|
|||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
liveItem.title as String,
|
liveItem.title,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500),
|
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
@ -99,7 +99,7 @@ class LiveContent extends StatelessWidget {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Text(
|
child: Text(
|
||||||
liveItem.uname as String,
|
liveItem.uname,
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
@ -114,10 +114,10 @@ class LiveContent extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class LiveStat extends StatelessWidget {
|
class LiveStat extends StatelessWidget {
|
||||||
const LiveStat({super.key, required this.online});
|
|
||||||
|
|
||||||
final int? online;
|
final int? online;
|
||||||
|
|
||||||
|
const LiveStat({Key? key, required this.online}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -136,7 +136,7 @@ class LiveStat extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: <Widget>[
|
children: [
|
||||||
// Row(
|
// Row(
|
||||||
// children: [
|
// children: [
|
||||||
// StatView(
|
// StatView(
|
||||||
|
@ -1,104 +1,78 @@
|
|||||||
import 'package:cached_network_image/cached_network_image.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:cached_network_image/cached_network_image.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/utils/extension.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/utils/global_data.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import '../../utils/storage.dart';
|
|
||||||
import '../constants.dart';
|
|
||||||
|
|
||||||
Box<dynamic> setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
|
|
||||||
class NetworkImgLayer extends StatelessWidget {
|
class NetworkImgLayer extends StatelessWidget {
|
||||||
|
final String? src;
|
||||||
|
final double? width;
|
||||||
|
final double? height;
|
||||||
|
final double? cacheW;
|
||||||
|
final double? cacheH;
|
||||||
|
final String? type;
|
||||||
|
final Duration? fadeOutDuration;
|
||||||
|
final Duration? fadeInDuration;
|
||||||
|
final int? quality;
|
||||||
|
|
||||||
const NetworkImgLayer({
|
const NetworkImgLayer({
|
||||||
super.key,
|
Key? key,
|
||||||
this.src,
|
this.src,
|
||||||
required this.width,
|
required this.width,
|
||||||
required this.height,
|
required this.height,
|
||||||
|
this.cacheW,
|
||||||
|
this.cacheH,
|
||||||
this.type,
|
this.type,
|
||||||
this.fadeOutDuration,
|
this.fadeOutDuration,
|
||||||
this.fadeInDuration,
|
this.fadeInDuration,
|
||||||
// 图片质量 默认1%
|
// 图片质量 默认1%
|
||||||
this.quality,
|
this.quality,
|
||||||
this.origAspectRatio,
|
}) : super(key: key);
|
||||||
});
|
|
||||||
|
|
||||||
final String? src;
|
|
||||||
final double width;
|
|
||||||
final double height;
|
|
||||||
final String? type;
|
|
||||||
final Duration? fadeOutDuration;
|
|
||||||
final Duration? fadeInDuration;
|
|
||||||
final int? quality;
|
|
||||||
final double? origAspectRatio;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final int defaultImgQuality = GlobalData().imgQuality;
|
double pr = MediaQuery.of(context).devicePixelRatio;
|
||||||
final String imageUrl =
|
int picQuality = setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
|
||||||
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? defaultImgQuality}q.webp';
|
|
||||||
print(imageUrl);
|
|
||||||
int? memCacheWidth, memCacheHeight;
|
|
||||||
double aspectRatio = (width / height).toDouble();
|
|
||||||
|
|
||||||
void setMemCacheSizes() {
|
// double pr = 2;
|
||||||
if (aspectRatio > 1) {
|
return src != ''
|
||||||
memCacheHeight = height.cacheSize(context);
|
|
||||||
} else if (aspectRatio < 1) {
|
|
||||||
memCacheWidth = width.cacheSize(context);
|
|
||||||
} else {
|
|
||||||
if (origAspectRatio != null && origAspectRatio! > 1) {
|
|
||||||
memCacheWidth = width.cacheSize(context);
|
|
||||||
} else if (origAspectRatio != null && origAspectRatio! < 1) {
|
|
||||||
memCacheHeight = height.cacheSize(context);
|
|
||||||
} else {
|
|
||||||
memCacheWidth = width.cacheSize(context);
|
|
||||||
memCacheHeight = height.cacheSize(context);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
setMemCacheSizes();
|
|
||||||
|
|
||||||
if (memCacheWidth == null && memCacheHeight == null) {
|
|
||||||
memCacheWidth = width.toInt();
|
|
||||||
}
|
|
||||||
|
|
||||||
return src != '' && src != null
|
|
||||||
? ClipRRect(
|
? ClipRRect(
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.hardEdge,
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(type == 'avatar'
|
||||||
type == 'avatar'
|
|
||||||
? 50
|
? 50
|
||||||
: type == 'emote'
|
: type == 'emote'
|
||||||
? 0
|
? 0
|
||||||
: StyleString.imgRadius.x,
|
: StyleString.imgRadius.x),
|
||||||
),
|
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: imageUrl,
|
imageUrl:
|
||||||
width: width,
|
'${src!.startsWith('//') ? 'https:${src!}' : src!}@${quality ?? picQuality}q.webp',
|
||||||
height: height,
|
width: width ?? double.infinity,
|
||||||
memCacheWidth: memCacheWidth,
|
height: height ?? double.infinity,
|
||||||
memCacheHeight: memCacheHeight,
|
alignment: Alignment.center,
|
||||||
|
maxWidthDiskCache: ((cacheW ?? width!) * pr).toInt(),
|
||||||
|
// maxHeightDiskCache: (cacheH ?? height!).toInt(),
|
||||||
|
memCacheWidth: ((cacheW ?? width!) * pr).toInt(),
|
||||||
|
// memCacheHeight: (cacheH ?? height!).toInt(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
fadeOutDuration:
|
fadeOutDuration:
|
||||||
fadeOutDuration ?? const Duration(milliseconds: 120),
|
fadeOutDuration ?? const Duration(milliseconds: 200),
|
||||||
fadeInDuration:
|
fadeInDuration:
|
||||||
fadeInDuration ?? const Duration(milliseconds: 120),
|
fadeInDuration ?? const Duration(milliseconds: 200),
|
||||||
filterQuality: FilterQuality.low,
|
// filterQuality: FilterQuality.high,
|
||||||
errorWidget: (BuildContext context, String url, Object error) =>
|
errorWidget: (context, url, error) => placeholder(context),
|
||||||
placeholder(context),
|
placeholder: (context, url) => placeholder(context),
|
||||||
placeholder: (BuildContext context, String url) =>
|
|
||||||
placeholder(context),
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: placeholder(context);
|
: placeholder(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget placeholder(BuildContext context) {
|
Widget placeholder(context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: width,
|
width: width ?? double.infinity,
|
||||||
height: height,
|
height: height ?? double.infinity,
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.hardEdge,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
||||||
borderRadius: BorderRadius.circular(type == 'avatar'
|
borderRadius: BorderRadius.circular(type == 'avatar'
|
||||||
@ -107,19 +81,14 @@ class NetworkImgLayer extends StatelessWidget {
|
|||||||
? 0
|
? 0
|
||||||
: StyleString.imgRadius.x),
|
: StyleString.imgRadius.x),
|
||||||
),
|
),
|
||||||
child: type == 'bg'
|
child: Center(
|
||||||
? const SizedBox()
|
|
||||||
: Center(
|
|
||||||
child: Image.asset(
|
child: Image.asset(
|
||||||
type == 'avatar'
|
type == 'avatar'
|
||||||
? 'assets/images/noface.jpeg'
|
? 'assets/images/noface.jpeg'
|
||||||
: 'assets/images/loading.png',
|
: 'assets/images/loading.png',
|
||||||
width: width,
|
width: 300,
|
||||||
height: height,
|
height: 300,
|
||||||
cacheWidth: width.cacheSize(context),
|
)),
|
||||||
cacheHeight: height.cacheSize(context),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../utils/download.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import '../constants.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'network_img_layer.dart';
|
import 'package:pilipala/utils/download.dart';
|
||||||
|
|
||||||
class OverlayPop extends StatelessWidget {
|
class OverlayPop extends StatelessWidget {
|
||||||
const OverlayPop({super.key, this.videoItem, this.closeFn});
|
|
||||||
|
|
||||||
final dynamic videoItem;
|
final dynamic videoItem;
|
||||||
final Function? closeFn;
|
final Function? closeFn;
|
||||||
|
const OverlayPop({super.key, this.videoItem, this.closeFn});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final double imgWidth = MediaQuery.sizeOf(context).width - 8 * 2;
|
double imgWidth = MediaQuery.of(context).size.width - 8 * 2;
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -20,6 +19,7 @@ class OverlayPop extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Stack(
|
Stack(
|
||||||
@ -27,7 +27,7 @@ class OverlayPop extends StatelessWidget {
|
|||||||
NetworkImgLayer(
|
NetworkImgLayer(
|
||||||
width: imgWidth,
|
width: imgWidth,
|
||||||
height: imgWidth / StyleString.aspectRatio,
|
height: imgWidth / StyleString.aspectRatio,
|
||||||
src: videoItem.pic! as String,
|
src: videoItem.pic!,
|
||||||
quality: 100,
|
quality: 100,
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
@ -61,7 +61,7 @@ class OverlayPop extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
videoItem.title! as String,
|
videoItem.title!,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
@ -69,10 +69,7 @@ class OverlayPop extends StatelessWidget {
|
|||||||
tooltip: '保存封面图',
|
tooltip: '保存封面图',
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await DownloadUtils.downloadImg(
|
await DownloadUtils.downloadImg(
|
||||||
videoItem.pic != null
|
videoItem.pic ?? videoItem.cover);
|
||||||
? videoItem.pic as String
|
|
||||||
: videoItem.cover as String,
|
|
||||||
);
|
|
||||||
// closeFn!();
|
// closeFn!();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.download, size: 20),
|
icon: const Icon(Icons.download, size: 20),
|
||||||
|
@ -17,8 +17,8 @@ class PullToRefreshHeader extends StatelessWidget {
|
|||||||
this.info,
|
this.info,
|
||||||
this.lastRefreshTime, {
|
this.lastRefreshTime, {
|
||||||
this.color,
|
this.color,
|
||||||
super.key,
|
Key? key,
|
||||||
});
|
}) : super(key: key);
|
||||||
|
|
||||||
final PullToRefreshScrollNotificationInfo? info;
|
final PullToRefreshScrollNotificationInfo? info;
|
||||||
final DateTime? lastRefreshTime;
|
final DateTime? lastRefreshTime;
|
||||||
@ -28,7 +28,7 @@ class PullToRefreshHeader extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final PullToRefreshScrollNotificationInfo? infos = info;
|
final PullToRefreshScrollNotificationInfo? infos = info;
|
||||||
if (infos == null) {
|
if (infos == null) {
|
||||||
return const SizedBox();
|
return Container();
|
||||||
}
|
}
|
||||||
String text = '';
|
String text = '';
|
||||||
if (infos.mode == PullToRefreshIndicatorMode.armed) {
|
if (infos.mode == PullToRefreshIndicatorMode.armed) {
|
||||||
@ -65,6 +65,7 @@ class PullToRefreshHeader extends StatelessWidget {
|
|||||||
top: top,
|
top: top,
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
|
@ -3,7 +3,7 @@ import 'package:pilipala/utils/utils.dart';
|
|||||||
|
|
||||||
class StatDanMu extends StatelessWidget {
|
class StatDanMu extends StatelessWidget {
|
||||||
final String? theme;
|
final String? theme;
|
||||||
final dynamic danmu;
|
final int? danmu;
|
||||||
final String? size;
|
final String? size;
|
||||||
|
|
||||||
const StatDanMu({Key? key, this.theme, this.danmu, this.size})
|
const StatDanMu({Key? key, this.theme, this.danmu, this.size})
|
||||||
|
@ -3,7 +3,7 @@ import 'package:pilipala/utils/utils.dart';
|
|||||||
|
|
||||||
class StatView extends StatelessWidget {
|
class StatView extends StatelessWidget {
|
||||||
final String? theme;
|
final String? theme;
|
||||||
final dynamic view;
|
final int? view;
|
||||||
final String? size;
|
final String? size;
|
||||||
|
|
||||||
const StatView({Key? key, this.theme, this.view, this.size})
|
const StatView({Key? key, this.theme, this.view, this.size})
|
||||||
|
@ -1,44 +1,36 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../http/search.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../http/user.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import '../../http/video.dart';
|
import 'package:pilipala/common/widgets/badge.dart';
|
||||||
import '../../utils/utils.dart';
|
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||||
import '../constants.dart';
|
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||||
import 'badge.dart';
|
import 'package:pilipala/http/search.dart';
|
||||||
import 'network_img_layer.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import 'stat/danmu.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
import 'stat/view.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
|
|
||||||
// 视频卡片 - 水平布局
|
// 视频卡片 - 水平布局
|
||||||
class VideoCardH extends StatelessWidget {
|
class VideoCardH extends StatelessWidget {
|
||||||
const VideoCardH({
|
|
||||||
super.key,
|
|
||||||
required this.videoItem,
|
|
||||||
this.longPress,
|
|
||||||
this.longPressEnd,
|
|
||||||
this.source = 'normal',
|
|
||||||
this.showOwner = true,
|
|
||||||
this.showView = true,
|
|
||||||
this.showDanmaku = true,
|
|
||||||
this.showPubdate = false,
|
|
||||||
});
|
|
||||||
// ignore: prefer_typing_uninitialized_variables
|
// ignore: prefer_typing_uninitialized_variables
|
||||||
final videoItem;
|
final videoItem;
|
||||||
final Function()? longPress;
|
final Function()? longPress;
|
||||||
final Function()? longPressEnd;
|
final Function()? longPressEnd;
|
||||||
final String source;
|
final String source;
|
||||||
final bool showOwner;
|
|
||||||
final bool showView;
|
const VideoCardH({
|
||||||
final bool showDanmaku;
|
Key? key,
|
||||||
final bool showPubdate;
|
required this.videoItem,
|
||||||
|
this.longPress,
|
||||||
|
this.longPressEnd,
|
||||||
|
this.source = 'normal',
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final int aid = videoItem.aid;
|
int aid = videoItem.aid;
|
||||||
final String bvid = videoItem.bvid;
|
String bvid = videoItem.bvid;
|
||||||
final String heroTag = Utils.makeHeroTag(aid);
|
String heroTag = Utils.makeHeroTag(aid);
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
if (longPress != null) {
|
if (longPress != null) {
|
||||||
@ -53,7 +45,7 @@ class VideoCardH extends StatelessWidget {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
try {
|
try {
|
||||||
final int cid =
|
int cid =
|
||||||
videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
videoItem.cid ?? await SearchHttp.ab2c(aid: aid, bvid: bvid);
|
||||||
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
Get.toNamed('/video?bvid=$bvid&cid=$cid',
|
||||||
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
|
arguments: {'videoItem': videoItem, 'heroTag': heroTag});
|
||||||
@ -65,11 +57,11 @@ class VideoCardH extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.fromLTRB(
|
padding: const EdgeInsets.fromLTRB(
|
||||||
StyleString.safeSpace, 5, StyleString.safeSpace, 5),
|
StyleString.safeSpace, 5, StyleString.safeSpace, 5),
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (BuildContext context, BoxConstraints boxConstraints) {
|
builder: (context, boxConstraints) {
|
||||||
final double width = (boxConstraints.maxWidth -
|
double width = (boxConstraints.maxWidth -
|
||||||
StyleString.cardSpace *
|
StyleString.cardSpace *
|
||||||
6 /
|
6 /
|
||||||
MediaQuery.textScalerOf(context).scale(1.0)) /
|
MediaQuery.of(context).textScaleFactor) /
|
||||||
2;
|
2;
|
||||||
return Container(
|
return Container(
|
||||||
constraints: const BoxConstraints(minHeight: 88),
|
constraints: const BoxConstraints(minHeight: 88),
|
||||||
@ -77,28 +69,29 @@ class VideoCardH extends StatelessWidget {
|
|||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: <Widget>[
|
children: [
|
||||||
AspectRatio(
|
AspectRatio(
|
||||||
aspectRatio: StyleString.aspectRatio,
|
aspectRatio: StyleString.aspectRatio,
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
builder: (BuildContext context,
|
builder: (context, boxConstraints) {
|
||||||
BoxConstraints boxConstraints) {
|
double maxWidth = boxConstraints.maxWidth;
|
||||||
final double maxWidth = boxConstraints.maxWidth;
|
double maxHeight = boxConstraints.maxHeight;
|
||||||
final double maxHeight = boxConstraints.maxHeight;
|
|
||||||
return Stack(
|
return Stack(
|
||||||
children: [
|
children: [
|
||||||
Hero(
|
Hero(
|
||||||
tag: heroTag,
|
tag: heroTag,
|
||||||
child: NetworkImgLayer(
|
child: NetworkImgLayer(
|
||||||
src: videoItem.pic as String,
|
src: videoItem.pic,
|
||||||
width: maxWidth,
|
width: maxWidth,
|
||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
PBadge(
|
PBadge(
|
||||||
text: Utils.timeFormat(videoItem.duration!),
|
text: Utils.timeFormat(videoItem.duration!),
|
||||||
|
top: null,
|
||||||
right: 6.0,
|
right: 6.0,
|
||||||
bottom: 6.0,
|
bottom: 6.0,
|
||||||
|
left: null,
|
||||||
type: 'gray',
|
type: 'gray',
|
||||||
),
|
),
|
||||||
// if (videoItem.rcmdReason != null &&
|
// if (videoItem.rcmdReason != null &&
|
||||||
@ -110,14 +103,7 @@ class VideoCardH extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
VideoContent(
|
VideoContent(videoItem: videoItem, source: source)
|
||||||
videoItem: videoItem,
|
|
||||||
source: source,
|
|
||||||
showOwner: showOwner,
|
|
||||||
showView: showView,
|
|
||||||
showDanmaku: showDanmaku,
|
|
||||||
showPubdate: showPubdate,
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -133,20 +119,8 @@ class VideoContent extends StatelessWidget {
|
|||||||
// ignore: prefer_typing_uninitialized_variables
|
// ignore: prefer_typing_uninitialized_variables
|
||||||
final videoItem;
|
final videoItem;
|
||||||
final String source;
|
final String source;
|
||||||
final bool showOwner;
|
const VideoContent(
|
||||||
final bool showView;
|
{super.key, required this.videoItem, this.source = 'normal'});
|
||||||
final bool showDanmaku;
|
|
||||||
final bool showPubdate;
|
|
||||||
|
|
||||||
const VideoContent({
|
|
||||||
super.key,
|
|
||||||
required this.videoItem,
|
|
||||||
this.source = 'normal',
|
|
||||||
this.showOwner = true,
|
|
||||||
this.showView = true,
|
|
||||||
this.showDanmaku = true,
|
|
||||||
this.showPubdate = false,
|
|
||||||
});
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -158,7 +132,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (videoItem.title is String) ...[
|
if (videoItem.title is String) ...[
|
||||||
Text(
|
Text(
|
||||||
videoItem.title as String,
|
videoItem.title,
|
||||||
textAlign: TextAlign.start,
|
textAlign: TextAlign.start,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
@ -171,9 +145,9 @@ class VideoContent extends StatelessWidget {
|
|||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
children: [
|
children: [
|
||||||
for (final i in videoItem.title) ...[
|
for (var i in videoItem.title) ...[
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: i['text'] as String,
|
text: i['text'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
letterSpacing: 0.3,
|
letterSpacing: 0.3,
|
||||||
@ -205,20 +179,12 @@ class VideoContent extends StatelessWidget {
|
|||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// const SizedBox(height: 4),
|
// const SizedBox(height: 4),
|
||||||
if (showPubdate)
|
|
||||||
Text(
|
|
||||||
Utils.dateFormat(videoItem.pubdate!),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 11, color: Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
|
||||||
if (showOwner)
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
videoItem.owner.name as String,
|
videoItem.owner.name,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize:
|
fontSize: Theme.of(context).textTheme.labelMedium!.fontSize,
|
||||||
Theme.of(context).textTheme.labelMedium!.fontSize,
|
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: Theme.of(context).colorScheme.outline,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -226,19 +192,21 @@ class VideoContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (showView) ...[
|
|
||||||
StatView(
|
StatView(
|
||||||
theme: 'gray',
|
theme: 'gray',
|
||||||
view: videoItem.stat.view as int,
|
view: videoItem.stat.view,
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
],
|
|
||||||
if (showDanmaku)
|
|
||||||
StatDanMu(
|
StatDanMu(
|
||||||
theme: 'gray',
|
theme: 'gray',
|
||||||
danmu: videoItem.stat.danmaku as int,
|
danmu: videoItem.stat.danmaku,
|
||||||
),
|
),
|
||||||
|
// Text(
|
||||||
|
// Utils.dateFormat(videoItem.pubdate!),
|
||||||
|
// style: TextStyle(
|
||||||
|
// fontSize: 11,
|
||||||
|
// color: Theme.of(context).colorScheme.outline),
|
||||||
|
// )
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
// SizedBox(
|
// SizedBox(
|
||||||
// width: 20,
|
// width: 20,
|
||||||
@ -266,6 +234,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
height: 24,
|
height: 24,
|
||||||
child: PopupMenuButton<String>(
|
child: PopupMenuButton<String>(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
tooltip: '稍后再看',
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.more_vert_outlined,
|
Icons.more_vert_outlined,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: Theme.of(context).colorScheme.outline,
|
||||||
@ -279,11 +248,11 @@ class VideoContent extends StatelessWidget {
|
|||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var res = await UserHttp.toViewLater(
|
var res = await UserHttp.toViewLater(
|
||||||
bvid: videoItem.bvid as String);
|
bvid: videoItem.bvid);
|
||||||
SmartDialog.showToast(res['msg']);
|
SmartDialog.showToast(res['msg']);
|
||||||
},
|
},
|
||||||
value: 'pause',
|
value: 'pause',
|
||||||
height: 40,
|
height: 35,
|
||||||
child: const Row(
|
child: const Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.watch_later_outlined, size: 16),
|
Icon(Icons.watch_later_outlined, size: 16),
|
||||||
@ -292,60 +261,6 @@ class VideoContent extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
onTap: () async {
|
|
||||||
SmartDialog.show(
|
|
||||||
useSystem: true,
|
|
||||||
animationType:
|
|
||||||
SmartAnimationType.centerFade_otherSlide,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('提示'),
|
|
||||||
content: Text(
|
|
||||||
'确定拉黑:${videoItem.owner.name}(${videoItem.owner.mid})?'
|
|
||||||
'\n\n注:被拉黑的Up可以在隐私设置-黑名单管理中解除'),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => SmartDialog.dismiss(),
|
|
||||||
child: Text(
|
|
||||||
'点错了',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context)
|
|
||||||
.colorScheme
|
|
||||||
.outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
var res = await VideoHttp.relationMod(
|
|
||||||
mid: videoItem.owner.mid,
|
|
||||||
act: 5,
|
|
||||||
reSrc: 11,
|
|
||||||
);
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
SmartDialog.showToast(res['code'] == 0
|
|
||||||
? '成功'
|
|
||||||
: res['msg']);
|
|
||||||
},
|
|
||||||
child: const Text('确认'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
value: 'pause',
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.block, size: 16),
|
|
||||||
const SizedBox(width: 6),
|
|
||||||
Text('拉黑:${videoItem.owner.name}',
|
|
||||||
style: const TextStyle(fontSize: 13))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import '../../models/model_rec_video_item.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'stat/danmu.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'stat/view.dart';
|
import 'package:pilipala/common/widgets/badge.dart';
|
||||||
import '../../http/dynamics.dart';
|
import 'package:pilipala/common/widgets/stat/danmu.dart';
|
||||||
import '../../http/search.dart';
|
import 'package:pilipala/common/widgets/stat/view.dart';
|
||||||
import '../../http/user.dart';
|
import 'package:pilipala/http/dynamics.dart';
|
||||||
import '../../http/video.dart';
|
import 'package:pilipala/http/search.dart';
|
||||||
import '../../models/common/search_type.dart';
|
import 'package:pilipala/http/user.dart';
|
||||||
import '../../utils/id_utils.dart';
|
import 'package:pilipala/models/common/search_type.dart';
|
||||||
import '../../utils/utils.dart';
|
import 'package:pilipala/utils/id_utils.dart';
|
||||||
import '../constants.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
import 'badge.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
import 'network_img_layer.dart';
|
|
||||||
|
|
||||||
// 视频卡片 - 垂直布局
|
// 视频卡片 - 垂直布局
|
||||||
class VideoCardV extends StatelessWidget {
|
class VideoCardV extends StatelessWidget {
|
||||||
@ -161,12 +159,12 @@ class VideoCardV extends StatelessWidget {
|
|||||||
height: maxHeight,
|
height: maxHeight,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (videoItem.duration > 0)
|
if (videoItem.duration != null)
|
||||||
if (crossAxisCount == 1) ...[
|
if (crossAxisCount == 1) ...[
|
||||||
PBadge(
|
PBadge(
|
||||||
bottom: 10,
|
bottom: 10,
|
||||||
right: 10,
|
right: 10,
|
||||||
text: Utils.timeFormat(videoItem.duration),
|
text: videoItem.duration,
|
||||||
)
|
)
|
||||||
] else ...[
|
] else ...[
|
||||||
PBadge(
|
PBadge(
|
||||||
@ -174,7 +172,7 @@ class VideoCardV extends StatelessWidget {
|
|||||||
right: 7,
|
right: 7,
|
||||||
size: 'small',
|
size: 'small',
|
||||||
type: 'gray',
|
type: 'gray',
|
||||||
text: Utils.timeFormat(videoItem.duration),
|
text: videoItem.duration,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -219,10 +217,15 @@ class VideoContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (videoItem.goto == 'av' && crossAxisCount == 1) ...[
|
if (videoItem.goto == 'av' && crossAxisCount == 1) ...[
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
VideoPopupMenu(
|
WatchLater(
|
||||||
size: 32,
|
size: 32,
|
||||||
iconSize: 18,
|
iconSize: 18,
|
||||||
videoItem: videoItem,
|
callFn: () async {
|
||||||
|
int aid = videoItem.param;
|
||||||
|
var res =
|
||||||
|
await UserHttp.toViewLater(bvid: IdUtils.av2bv(aid));
|
||||||
|
SmartDialog.showToast(res['msg']);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -231,7 +234,6 @@ class VideoContent extends StatelessWidget {
|
|||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
VideoStat(
|
VideoStat(
|
||||||
videoItem: videoItem,
|
videoItem: videoItem,
|
||||||
crossAxisCount: crossAxisCount,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (crossAxisCount == 1) const SizedBox(height: 4),
|
if (crossAxisCount == 1) const SizedBox(height: 4),
|
||||||
@ -264,14 +266,6 @@ class VideoContent extends StatelessWidget {
|
|||||||
fs: 9,
|
fs: 9,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
if (videoItem.isFollowed == 1) ...[
|
|
||||||
const PBadge(
|
|
||||||
text: '已关注',
|
|
||||||
stack: 'normal',
|
|
||||||
size: 'small',
|
|
||||||
type: 'color',
|
|
||||||
)
|
|
||||||
],
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: crossAxisCount == 1 ? 0 : 1,
|
flex: crossAxisCount == 1 ? 0 : 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -295,15 +289,19 @@ class VideoContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
VideoStat(
|
VideoStat(
|
||||||
videoItem: videoItem,
|
videoItem: videoItem,
|
||||||
crossAxisCount: crossAxisCount,
|
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
if (videoItem.goto == 'av' && crossAxisCount != 1) ...[
|
if (videoItem.goto == 'av' && crossAxisCount != 1) ...[
|
||||||
VideoPopupMenu(
|
WatchLater(
|
||||||
size: 24,
|
size: 24,
|
||||||
iconSize: 14,
|
iconSize: 14,
|
||||||
videoItem: videoItem,
|
callFn: () async {
|
||||||
|
int aid = videoItem.param;
|
||||||
|
var res =
|
||||||
|
await UserHttp.toViewLater(bvid: IdUtils.av2bv(aid));
|
||||||
|
SmartDialog.showToast(res['msg']);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
const SizedBox(height: 24)
|
const SizedBox(height: 24)
|
||||||
@ -319,55 +317,40 @@ class VideoContent extends StatelessWidget {
|
|||||||
|
|
||||||
class VideoStat extends StatelessWidget {
|
class VideoStat extends StatelessWidget {
|
||||||
final dynamic videoItem;
|
final dynamic videoItem;
|
||||||
final int crossAxisCount;
|
|
||||||
|
|
||||||
const VideoStat({
|
const VideoStat({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.videoItem,
|
required this.videoItem,
|
||||||
required this.crossAxisCount,
|
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Row(
|
return RichText(
|
||||||
children: [
|
|
||||||
StatView(
|
|
||||||
theme: 'gray',
|
|
||||||
view: videoItem.stat.view,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 8),
|
|
||||||
StatDanMu(
|
|
||||||
theme: 'gray',
|
|
||||||
danmu: videoItem.stat.danmu,
|
|
||||||
),
|
|
||||||
if (videoItem is RecVideoItemModel) ...<Widget>[
|
|
||||||
crossAxisCount > 1 ? const Spacer() : const SizedBox(width: 8),
|
|
||||||
RichText(
|
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
|
fontSize: Theme.of(context).textTheme.labelSmall!.fontSize,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: Theme.of(context).colorScheme.outline,
|
||||||
),
|
),
|
||||||
text: Utils.formatTimestampToRelativeTime(videoItem.pubdate)),
|
children: [
|
||||||
),
|
TextSpan(text: '${videoItem.stat.view}观看'),
|
||||||
const SizedBox(width: 4),
|
TextSpan(text: ' • ${videoItem.stat.danmu}弹幕'),
|
||||||
]
|
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class VideoPopupMenu extends StatelessWidget {
|
class WatchLater extends StatelessWidget {
|
||||||
final double? size;
|
final double? size;
|
||||||
final double? iconSize;
|
final double? iconSize;
|
||||||
final dynamic videoItem;
|
final Function? callFn;
|
||||||
|
|
||||||
const VideoPopupMenu({
|
const WatchLater({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.size,
|
required this.size,
|
||||||
required this.iconSize,
|
required this.iconSize,
|
||||||
required this.videoItem,
|
this.callFn,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -377,6 +360,7 @@ class VideoPopupMenu extends StatelessWidget {
|
|||||||
height: size,
|
height: size,
|
||||||
child: PopupMenuButton<String>(
|
child: PopupMenuButton<String>(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
tooltip: '稍后再看',
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.more_vert_outlined,
|
Icons.more_vert_outlined,
|
||||||
color: Theme.of(context).colorScheme.outline,
|
color: Theme.of(context).colorScheme.outline,
|
||||||
@ -387,13 +371,9 @@ class VideoPopupMenu extends StatelessWidget {
|
|||||||
onSelected: (String type) {},
|
onSelected: (String type) {},
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry<String>>[
|
||||||
PopupMenuItem<String>(
|
PopupMenuItem<String>(
|
||||||
onTap: () async {
|
onTap: () => callFn!(),
|
||||||
var res =
|
|
||||||
await UserHttp.toViewLater(bvid: videoItem.bvid as String);
|
|
||||||
SmartDialog.showToast(res['msg']);
|
|
||||||
},
|
|
||||||
value: 'pause',
|
value: 'pause',
|
||||||
height: 40,
|
height: 35,
|
||||||
child: const Row(
|
child: const Row(
|
||||||
children: [
|
children: [
|
||||||
Icon(Icons.watch_later_outlined, size: 16),
|
Icon(Icons.watch_later_outlined, size: 16),
|
||||||
@ -402,55 +382,6 @@ class VideoPopupMenu extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuDivider(),
|
|
||||||
PopupMenuItem<String>(
|
|
||||||
onTap: () async {
|
|
||||||
SmartDialog.show(
|
|
||||||
useSystem: true,
|
|
||||||
animationType: SmartAnimationType.centerFade_otherSlide,
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: const Text('提示'),
|
|
||||||
content: Text(
|
|
||||||
'确定拉黑:${videoItem.owner.name}(${videoItem.owner.mid})?'
|
|
||||||
'\n\n注:被拉黑的Up可以在隐私设置-黑名单管理中解除'),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () => SmartDialog.dismiss(),
|
|
||||||
child: Text(
|
|
||||||
'点错了',
|
|
||||||
style: TextStyle(
|
|
||||||
color: Theme.of(context).colorScheme.outline),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
var res = await VideoHttp.relationMod(
|
|
||||||
mid: videoItem.owner.mid,
|
|
||||||
act: 5,
|
|
||||||
reSrc: 11,
|
|
||||||
);
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
SmartDialog.showToast(res['msg'] ?? '成功');
|
|
||||||
},
|
|
||||||
child: const Text('确认'),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
value: 'pause',
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.block, size: 16),
|
|
||||||
const SizedBox(width: 6),
|
|
||||||
Text('拉黑:${videoItem.owner.name}',
|
|
||||||
style: const TextStyle(fontSize: 13))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
import 'constants.dart';
|
|
||||||
|
|
||||||
class Api {
|
class Api {
|
||||||
// 推荐视频
|
// 推荐视频
|
||||||
static const String recommendListApp =
|
static const String recommendListApp =
|
||||||
'${HttpString.appBaseUrl}/x/v2/feed/index';
|
'https://app.bilibili.com/x/v2/feed/index';
|
||||||
static const String recommendListWeb = '/x/web-interface/index/top/feed/rcmd';
|
static const String recommendList = '/x/web-interface/index/top/feed/rcmd';
|
||||||
|
|
||||||
// 热门视频
|
// 热门视频
|
||||||
static const String hotList = '/x/web-interface/popular';
|
static const String hotList = '/x/web-interface/popular';
|
||||||
|
|
||||||
// 视频流
|
// 视频流
|
||||||
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
// https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
|
||||||
static const String videoUrl = '/x/player/wbi/playurl';
|
static const String videoUrl = '/x/player/playurl';
|
||||||
|
|
||||||
// 视频详情
|
// 视频详情
|
||||||
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
|
// 竖屏 https://api.bilibili.com/x/web-interface/view?aid=527403921
|
||||||
@ -99,8 +97,8 @@ class Api {
|
|||||||
// 操作用户关系
|
// 操作用户关系
|
||||||
static const String relationMod = '/x/relation/modify';
|
static const String relationMod = '/x/relation/modify';
|
||||||
|
|
||||||
// 相互关系查询 // 失效
|
// 相互关系查询
|
||||||
// static const String relationSearch = '/x/space/wbi/acc/relation';
|
static const String relationSearch = '/x/space/wbi/acc/relation';
|
||||||
|
|
||||||
// 评论列表
|
// 评论列表
|
||||||
// https://api.bilibili.com/x/v2/reply/main?csrf=6e22efc1a47225ea25f901f922b5cfdd&mode=3&oid=254175381&pagination_str=%7B%22offset%22:%22%22%7D&plat=1&seek_rpid=0&type=11
|
// https://api.bilibili.com/x/v2/reply/main?csrf=6e22efc1a47225ea25f901f922b5cfdd&mode=3&oid=254175381&pagination_str=%7B%22offset%22:%22%22%7D&plat=1&seek_rpid=0&type=11
|
||||||
@ -154,7 +152,7 @@ class Api {
|
|||||||
|
|
||||||
// 动态点赞
|
// 动态点赞
|
||||||
static const String likeDynamic =
|
static const String likeDynamic =
|
||||||
'${HttpString.tUrl}/dynamic_like/v1/dynamic_like/thumb';
|
'https://api.vc.bilibili.com/dynamic_like/v1/dynamic_like/thumb';
|
||||||
|
|
||||||
// 获取稍后再看
|
// 获取稍后再看
|
||||||
static const String seeYouLater = '/x/v2/history/toview';
|
static const String seeYouLater = '/x/v2/history/toview';
|
||||||
@ -185,7 +183,7 @@ class Api {
|
|||||||
static const String searchDefault = '/x/web-interface/wbi/search/default';
|
static const String searchDefault = '/x/web-interface/wbi/search/default';
|
||||||
|
|
||||||
// 搜索关键词
|
// 搜索关键词
|
||||||
static const String searchSuggest =
|
static const String serachSuggest =
|
||||||
'https://s.search.bilibili.com/main/suggest';
|
'https://s.search.bilibili.com/main/suggest';
|
||||||
|
|
||||||
// 分类搜索
|
// 分类搜索
|
||||||
@ -214,28 +212,21 @@ class Api {
|
|||||||
// https://api.bilibili.com/x/relation/tags
|
// https://api.bilibili.com/x/relation/tags
|
||||||
static const String followingsClass = '/x/relation/tags';
|
static const String followingsClass = '/x/relation/tags';
|
||||||
|
|
||||||
// 搜索follow
|
|
||||||
static const followSearch = '/x/relation/followings/search';
|
|
||||||
|
|
||||||
// 粉丝
|
// 粉丝
|
||||||
// vmid 用户id pn 页码 ps 每页个数,最大50 order: desc
|
// vmid 用户id pn 页码 ps 每页个数,最大50 order: desc
|
||||||
// order_type 排序规则 最近访问传空,最常访问传 attention
|
// order_type 排序规则 最近访问传空,最常访问传 attention
|
||||||
static const String fans = '/x/relation/fans';
|
static const String fans = 'https://api.bilibili.com/x/relation/fans';
|
||||||
|
|
||||||
// 直播
|
// 直播
|
||||||
// ?page=1&page_size=30&platform=web
|
// ?page=1&page_size=30&platform=web
|
||||||
static const String liveList =
|
static const String liveList =
|
||||||
'${HttpString.liveBaseUrl}/xlive/web-interface/v1/second/getUserRecommend';
|
'https://api.live.bilibili.com/xlive/web-interface/v1/second/getUserRecommend';
|
||||||
|
|
||||||
// 直播间详情
|
// 直播间详情
|
||||||
// cid roomId
|
// cid roomId
|
||||||
// qn 80:流畅,150:高清,400:蓝光,10000:原画,20000:4K, 30000:杜比
|
// qn 80:流畅,150:高清,400:蓝光,10000:原画,20000:4K, 30000:杜比
|
||||||
static const String liveRoomInfo =
|
static const String liveRoomInfo =
|
||||||
'${HttpString.liveBaseUrl}/xlive/web-room/v2/index/getRoomPlayInfo';
|
'https://api.live.bilibili.com/xlive/web-room/v2/index/getRoomPlayInfo';
|
||||||
|
|
||||||
// 直播间详情 H5
|
|
||||||
static const String liveRoomInfoH5 =
|
|
||||||
'${HttpString.liveBaseUrl}/xlive/web-room/v1/index/getH5InfoByRoom';
|
|
||||||
|
|
||||||
// 用户信息 需要Wbi签名
|
// 用户信息 需要Wbi签名
|
||||||
// https://api.bilibili.com/x/space/wbi/acc/info?mid=503427686&token=&platform=web&web_location=1550101&w_rid=d709892496ce93e3d94d6d37c95bde91&wts=1689301482
|
// https://api.bilibili.com/x/space/wbi/acc/info?mid=503427686&token=&platform=web&web_location=1550101&w_rid=d709892496ce93e3d94d6d37c95bde91&wts=1689301482
|
||||||
@ -321,10 +312,6 @@ class Api {
|
|||||||
|
|
||||||
static const String webDanmaku = '/x/v2/dm/web/seg.so';
|
static const String webDanmaku = '/x/v2/dm/web/seg.so';
|
||||||
|
|
||||||
//发送视频弹幕
|
|
||||||
//https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/danmaku/action.md
|
|
||||||
static const String shootDanmaku = '/x/v2/dm/post';
|
|
||||||
|
|
||||||
// up主分组
|
// up主分组
|
||||||
static const String followUpTag = '/x/relation/tags';
|
static const String followUpTag = '/x/relation/tags';
|
||||||
|
|
||||||
@ -335,51 +322,6 @@ class Api {
|
|||||||
// 获取指定分组下的up
|
// 获取指定分组下的up
|
||||||
static const String followUpGroup = '/x/relation/tag';
|
static const String followUpGroup = '/x/relation/tag';
|
||||||
|
|
||||||
/// 私聊
|
|
||||||
/// 'https://api.vc.bilibili.com/session_svr/v1/session_svr/get_sessions?
|
|
||||||
/// session_type=1&
|
|
||||||
/// group_fold=1&
|
|
||||||
/// unfollow_fold=0&
|
|
||||||
/// sort_rule=2&
|
|
||||||
/// build=0&
|
|
||||||
/// mobi_app=web&
|
|
||||||
/// w_rid=8641d157fb9a9255eb2159f316ee39e2&
|
|
||||||
/// wts=1697305010
|
|
||||||
|
|
||||||
static const String sessionList =
|
|
||||||
'${HttpString.tUrl}/session_svr/v1/session_svr/get_sessions';
|
|
||||||
|
|
||||||
/// 私聊用户信息
|
|
||||||
/// uids
|
|
||||||
/// build=0&mobi_app=web
|
|
||||||
static const String sessionAccountList =
|
|
||||||
'${HttpString.tUrl}/account/v1/user/cards';
|
|
||||||
|
|
||||||
/// https://api.vc.bilibili.com/svr_sync/v1/svr_sync/fetch_session_msgs?
|
|
||||||
/// talker_id=400787461&
|
|
||||||
/// session_type=1&
|
|
||||||
/// size=20&
|
|
||||||
/// sender_device_id=1&
|
|
||||||
/// build=0&
|
|
||||||
/// mobi_app=web&
|
|
||||||
/// web_location=333.1296&
|
|
||||||
/// w_rid=cfe3bf58c9fe181bbf4dd6c75175e6b0&
|
|
||||||
/// wts=1697350697
|
|
||||||
|
|
||||||
static const String sessionMsg =
|
|
||||||
'${HttpString.tUrl}/svr_sync/v1/svr_sync/fetch_session_msgs';
|
|
||||||
|
|
||||||
/// 标记已读 POST
|
|
||||||
/// talker_id:
|
|
||||||
/// session_type: 1
|
|
||||||
/// ack_seqno: 920224140918926
|
|
||||||
/// build: 0
|
|
||||||
/// mobi_app: web
|
|
||||||
/// csrf_token:
|
|
||||||
/// csrf:
|
|
||||||
static const String updateAck =
|
|
||||||
'${HttpString.tUrl}/session_svr/v1/session_svr/update_ack';
|
|
||||||
|
|
||||||
// 获取某个动态详情
|
// 获取某个动态详情
|
||||||
// timezone_offset=-480
|
// timezone_offset=-480
|
||||||
// id=849312409672744983
|
// id=849312409672744983
|
||||||
@ -397,11 +339,11 @@ class Api {
|
|||||||
|
|
||||||
// captcha验证码
|
// captcha验证码
|
||||||
static const String getCaptcha =
|
static const String getCaptcha =
|
||||||
'${HttpString.passBaseUrl}/x/passport-login/captcha?source=main_web';
|
'https://passport.bilibili.com/x/passport-login/captcha?source=main_web';
|
||||||
|
|
||||||
// web端短信验证码
|
// web端短信验证码
|
||||||
static const String smsCode =
|
static const String smsCode =
|
||||||
'${HttpString.passBaseUrl}/x/passport-login/web/sms/send';
|
'https://passport.bilibili.com/x/passport-login/web/sms/send';
|
||||||
|
|
||||||
// web端验证码登录
|
// web端验证码登录
|
||||||
|
|
||||||
@ -409,7 +351,7 @@ class Api {
|
|||||||
|
|
||||||
// app端短信验证码
|
// app端短信验证码
|
||||||
static const String appSmsCode =
|
static const String appSmsCode =
|
||||||
'${HttpString.passBaseUrl}/x/passport-login/sms/send';
|
'https://passport.bilibili.com/x/passport-login/sms/send';
|
||||||
|
|
||||||
// app端验证码登录
|
// app端验证码登录
|
||||||
|
|
||||||
@ -423,83 +365,11 @@ class Api {
|
|||||||
/// key
|
/// key
|
||||||
/// rhash
|
/// rhash
|
||||||
static const String loginInByPwdApi =
|
static const String loginInByPwdApi =
|
||||||
'${HttpString.passBaseUrl}/x/passport-login/oauth2/login';
|
'https://passport.bilibili.com/x/passport-login/oauth2/login';
|
||||||
|
|
||||||
/// 密码加密密钥
|
/// 密码加密密钥
|
||||||
/// disable_rcmd
|
/// disable_rcmd
|
||||||
/// local_id
|
/// local_id
|
||||||
static const getWebKey = '${HttpString.passBaseUrl}/x/passport-login/web/key';
|
static const getWebKey =
|
||||||
|
'https://passport.bilibili.com/x/passport-login/web/key';
|
||||||
/// cookie转access_key
|
|
||||||
static const cookieToKey =
|
|
||||||
'${HttpString.passBaseUrl}/x/passport-tv-login/h5/qrcode/confirm';
|
|
||||||
|
|
||||||
/// 申请二维码(TV端)
|
|
||||||
static const getTVCode =
|
|
||||||
'https://passport.snm0516.aisee.tv/x/passport-tv-login/qrcode/auth_code';
|
|
||||||
|
|
||||||
///扫码登录(TV端)
|
|
||||||
static const qrcodePoll =
|
|
||||||
'${HttpString.passBaseUrl}/x/passport-tv-login/qrcode/poll';
|
|
||||||
|
|
||||||
/// 置顶视频
|
|
||||||
static const getTopVideoApi = '/x/space/top/arc';
|
|
||||||
|
|
||||||
/// 主页 - 最近投币的视频
|
|
||||||
/// vmid
|
|
||||||
/// gaia_source = main_web
|
|
||||||
/// web_location
|
|
||||||
/// w_rid
|
|
||||||
/// wts
|
|
||||||
static const getRecentCoinVideoApi = '/x/space/coin/video';
|
|
||||||
|
|
||||||
/// 最近点赞的视频
|
|
||||||
static const getRecentLikeVideoApi = '/x/space/like/video';
|
|
||||||
|
|
||||||
/// 最近追番
|
|
||||||
static const getRecentBangumiApi = '/x/space/bangumi/follow/list';
|
|
||||||
|
|
||||||
/// 用户专栏
|
|
||||||
static const getMemberSeasonsApi = '/x/polymer/web-space/home/seasons_series';
|
|
||||||
|
|
||||||
/// 获赞数 播放数
|
|
||||||
/// mid
|
|
||||||
static const getMemberViewApi = '/x/space/upstat';
|
|
||||||
|
|
||||||
/// 查询某个专栏
|
|
||||||
/// mid
|
|
||||||
/// season_id
|
|
||||||
/// sort_reverse
|
|
||||||
/// page_num
|
|
||||||
/// page_size
|
|
||||||
static const getSeasonDetailApi =
|
|
||||||
'/x/polymer/web-space/seasons_archives_list';
|
|
||||||
|
|
||||||
/// 获取未读动态数
|
|
||||||
static const getUnreadDynamic = '/x/web-interface/dynamic/entrance';
|
|
||||||
|
|
||||||
/// 用户动态主页
|
|
||||||
static const dynamicSpmPrefix = 'https://space.bilibili.com/1/dynamic';
|
|
||||||
|
|
||||||
/// 激活buvid3
|
|
||||||
static const activateBuvidApi = '/x/internal/gaia-gateway/ExClimbWuzhi';
|
|
||||||
|
|
||||||
/// 我的订阅
|
|
||||||
static const userSubFolder = '/x/v3/fav/folder/collected/list';
|
|
||||||
|
|
||||||
/// 我的订阅详情
|
|
||||||
static const userSubFolderDetail = '/x/space/fav/season/list';
|
|
||||||
|
|
||||||
/// 取消订阅
|
|
||||||
static const userSubCancel = '/x/v3/fav/season/unfav';
|
|
||||||
|
|
||||||
/// 表情
|
|
||||||
static const emojiList = '/x/emote/user/panel/web';
|
|
||||||
|
|
||||||
/// 已读标记
|
|
||||||
static const String ackSessionMsg =
|
|
||||||
'${HttpString.tUrl}/session_svr/v1/session_svr/update_ack';
|
|
||||||
|
|
||||||
/// 发送私信
|
|
||||||
static const String sendMsg = '${HttpString.tUrl}/web_im/v1/web_im/send_msg';
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import '../models/bangumi/list.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/models/bangumi/list.dart';
|
||||||
|
|
||||||
class BangumiHttp {
|
class BangumiHttp {
|
||||||
static Future bangumiList({int? page}) async {
|
static Future bangumiList({int? page}) async {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import '../models/user/black.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/models/user/black.dart';
|
||||||
|
|
||||||
class BlackHttp {
|
class BlackHttp {
|
||||||
static Future blackList({required int pn, int? ps}) async {
|
static Future blackList({required int pn, int? ps}) async {
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
import 'index.dart';
|
|
||||||
|
|
||||||
class CommonHttp {
|
|
||||||
static Future unReadDynamic() async {
|
|
||||||
var res = await Request().get(Api.getUnreadDynamic,
|
|
||||||
data: {'alltype_offset': 0, 'video_offset': '', 'article_offset': 0});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {'status': true, 'data': res.data['data']['dyn_basic_infos']};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,10 +1,7 @@
|
|||||||
class HttpString {
|
class HttpString {
|
||||||
static const String baseUrl = 'https://www.bilibili.com';
|
static const String baseUrl = 'https://www.bilibili.com';
|
||||||
static const String apiBaseUrl = 'https://api.bilibili.com';
|
static const String baseApiUrl = 'https://api.bilibili.com';
|
||||||
static const String tUrl = 'https://api.vc.bilibili.com';
|
static const String tUrl = 'https://api.vc.bilibili.com';
|
||||||
static const String appBaseUrl = 'https://app.bilibili.com';
|
|
||||||
static const String liveBaseUrl = 'https://api.live.bilibili.com';
|
|
||||||
static const String passBaseUrl = 'https://passport.bilibili.com';
|
|
||||||
static const List<int> validateStatusCodes = [
|
static const List<int> validateStatusCodes = [
|
||||||
302,
|
302,
|
||||||
304,
|
304,
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import '../models/danmaku/dm.pb.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
|
import 'package:pilipala/models/danmaku/dm.pb.dart';
|
||||||
|
|
||||||
|
import 'constants.dart';
|
||||||
|
|
||||||
class DanmakaHttp {
|
class DanmakaHttp {
|
||||||
// 获取视频弹幕
|
// 获取视频弹幕
|
||||||
@ -21,74 +24,4 @@ class DanmakaHttp {
|
|||||||
);
|
);
|
||||||
return DmSegMobileReply.fromBuffer(response.data);
|
return DmSegMobileReply.fromBuffer(response.data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future shootDanmaku({
|
|
||||||
int type = 1, //弹幕类选择(1:视频弹幕 2:漫画弹幕)
|
|
||||||
required int oid, // 视频cid
|
|
||||||
required String msg, //弹幕文本(长度小于 100 字符)
|
|
||||||
int mode =
|
|
||||||
1, // 弹幕类型(1:滚动弹幕 4:底端弹幕 5:顶端弹幕 6:逆向弹幕(不能使用) 7:高级弹幕 8:代码弹幕(不能使用) 9:BAS弹幕(pool必须为2))
|
|
||||||
// String? aid,// 稿件avid
|
|
||||||
// String? bvid,// bvid与aid必须有一个
|
|
||||||
required String bvid,
|
|
||||||
int? progress, // 弹幕出现在视频内的时间(单位为毫秒,默认为0)
|
|
||||||
int? color, // 弹幕颜色(默认白色,16777215)
|
|
||||||
int? fontsize, // 弹幕字号(默认25)
|
|
||||||
int? pool, // 弹幕池选择(0:普通池 1:字幕池 2:特殊池(代码/BAS弹幕)默认普通池,0)
|
|
||||||
//int? rnd,// 当前时间戳*1000000(若无此项,则发送弹幕冷却时间限制为90s;若有此项,则发送弹幕冷却时间限制为5s)
|
|
||||||
int? colorful, //60001:专属渐变彩色(需要会员)
|
|
||||||
int? checkbox_type, //是否带 UP 身份标识(0:普通;4:带有标识)
|
|
||||||
// String? csrf,//CSRF Token(位于 Cookie) Cookie 方式必要
|
|
||||||
// String? access_key,// APP 登录 Token APP 方式必要
|
|
||||||
}) async {
|
|
||||||
// 构建参数对象
|
|
||||||
// assert(aid != null || bvid != null);
|
|
||||||
// assert(csrf != null || access_key != null);
|
|
||||||
assert(msg.length < 100);
|
|
||||||
// 构建参数对象
|
|
||||||
var params = <String, dynamic>{
|
|
||||||
'type': type,
|
|
||||||
'oid': oid,
|
|
||||||
'msg': msg,
|
|
||||||
'mode': mode,
|
|
||||||
//'aid': aid,
|
|
||||||
'bvid': bvid,
|
|
||||||
'progress': progress,
|
|
||||||
'color': color,
|
|
||||||
'fontsize': fontsize,
|
|
||||||
'pool': pool,
|
|
||||||
'rnd': DateTime.now().microsecondsSinceEpoch,
|
|
||||||
'colorful': colorful,
|
|
||||||
'checkbox_type': checkbox_type,
|
|
||||||
'csrf': await Request.getCsrf(),
|
|
||||||
// 'access_key': access_key,
|
|
||||||
}..removeWhere((key, value) => value == null);
|
|
||||||
|
|
||||||
var response = await Request().post(
|
|
||||||
Api.shootDanmaku,
|
|
||||||
data: params,
|
|
||||||
options: Options(
|
|
||||||
contentType: Headers.formUrlEncodedContentType,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
if (response.statusCode != 200) {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': '弹幕发送失败,状态码:${response.statusCode}',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (response.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': response.data['data'],
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': "${response.data['code']}: ${response.data['message']}",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import '../models/dynamics/result.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import '../models/dynamics/up.dart';
|
import 'package:pilipala/models/dynamics/result.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/models/dynamics/up.dart';
|
||||||
|
|
||||||
class DynamicsHttp {
|
class DynamicsHttp {
|
||||||
static Future followDynamic({
|
static Future followDynamic({
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import '../models/fans/result.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/models/fans/result.dart';
|
||||||
|
|
||||||
class FanHttp {
|
class FanHttp {
|
||||||
static Future fans({int? vmid, int? pn, int? ps, String? orderType}) async {
|
static Future fans({int? vmid, int? pn, int? ps, String? orderType}) async {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import '../models/follow/result.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/models/follow/result.dart';
|
||||||
|
|
||||||
class FollowHttp {
|
class FollowHttp {
|
||||||
static Future followings(
|
static Future followings(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import 'package:html/dom.dart';
|
import 'package:html/dom.dart';
|
||||||
import 'package:html/parser.dart';
|
import 'package:html/parser.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
|
|
||||||
class HtmlHttp {
|
class HtmlHttp {
|
||||||
// article
|
// article
|
||||||
@ -15,7 +15,7 @@ class HtmlHttp {
|
|||||||
Match match = regex.firstMatch(response.data)!;
|
Match match = regex.firstMatch(response.data)!;
|
||||||
String matchedString = match.group(0)!;
|
String matchedString = match.group(0)!;
|
||||||
response = await Request().get(
|
response = await Request().get(
|
||||||
'https:$matchedString/',
|
'https:$matchedString' + '/',
|
||||||
extra: {'ua': 'pc'},
|
extra: {'ua': 'pc'},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -40,13 +40,9 @@ class HtmlHttp {
|
|||||||
//
|
//
|
||||||
String opusContent =
|
String opusContent =
|
||||||
opusDetail.querySelector('.opus-module-content')!.innerHtml;
|
opusDetail.querySelector('.opus-module-content')!.innerHtml;
|
||||||
String? test;
|
String test = opusDetail
|
||||||
try {
|
|
||||||
test = opusDetail
|
|
||||||
.querySelector('.horizontal-scroll-album__pic__img')!
|
.querySelector('.horizontal-scroll-album__pic__img')!
|
||||||
.innerHtml;
|
.innerHtml;
|
||||||
} catch (_) {}
|
|
||||||
|
|
||||||
String commentId = opusDetail
|
String commentId = opusDetail
|
||||||
.querySelector('.bili-comment-container')!
|
.querySelector('.bili-comment-container')!
|
||||||
.className
|
.className
|
||||||
@ -58,7 +54,7 @@ class HtmlHttp {
|
|||||||
'avatar': avatar,
|
'avatar': avatar,
|
||||||
'uname': uname,
|
'uname': uname,
|
||||||
'updateTime': updateTime,
|
'updateTime': updateTime,
|
||||||
'content': (test ?? '') + opusContent,
|
'content': test + opusContent,
|
||||||
'commentId': int.parse(commentId)
|
'commentId': int.parse(commentId)
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -1,21 +1,17 @@
|
|||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print
|
||||||
import 'dart:async';
|
|
||||||
import 'dart:convert';
|
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:math' show Random;
|
import 'dart:async';
|
||||||
import 'package:cookie_jar/cookie_jar.dart';
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:cookie_jar/cookie_jar.dart';
|
||||||
import 'package:dio/io.dart';
|
import 'package:dio/io.dart';
|
||||||
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
|
import 'package:dio_http2_adapter/dio_http2_adapter.dart';
|
||||||
// import 'package:dio_http2_adapter/dio_http2_adapter.dart';
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import '../utils/storage.dart';
|
import 'package:pilipala/utils/utils.dart';
|
||||||
import '../utils/utils.dart';
|
import 'package:pilipala/http/constants.dart';
|
||||||
import 'api.dart';
|
import 'package:pilipala/http/interceptor.dart';
|
||||||
import 'constants.dart';
|
import 'package:dio_cookie_manager/dio_cookie_manager.dart';
|
||||||
import 'interceptor.dart';
|
|
||||||
|
|
||||||
class Request {
|
class Request {
|
||||||
static final Request _instance = Request._internal();
|
static final Request _instance = Request._internal();
|
||||||
@ -24,26 +20,25 @@ class Request {
|
|||||||
factory Request() => _instance;
|
factory Request() => _instance;
|
||||||
Box setting = GStrorage.setting;
|
Box setting = GStrorage.setting;
|
||||||
static Box localCache = GStrorage.localCache;
|
static Box localCache = GStrorage.localCache;
|
||||||
late bool enableSystemProxy;
|
late dynamic enableSystemProxy;
|
||||||
late String systemProxyHost;
|
late String systemProxyHost;
|
||||||
late String systemProxyPort;
|
late String systemProxyPort;
|
||||||
static final RegExp spmPrefixExp = RegExp(r'<meta name="spm_prefix" content="([^"]+?)">');
|
|
||||||
|
|
||||||
/// 设置cookie
|
/// 设置cookie
|
||||||
static setCookie() async {
|
static setCookie() async {
|
||||||
Box userInfoCache = GStrorage.userInfo;
|
Box userInfoCache = GStrorage.userInfo;
|
||||||
final String cookiePath = await Utils.getCookiePath();
|
var cookiePath = await Utils.getCookiePath();
|
||||||
final PersistCookieJar cookieJar = PersistCookieJar(
|
var cookieJar = PersistCookieJar(
|
||||||
ignoreExpires: true,
|
ignoreExpires: true,
|
||||||
storage: FileStorage(cookiePath),
|
storage: FileStorage(cookiePath),
|
||||||
);
|
);
|
||||||
cookieManager = CookieManager(cookieJar);
|
cookieManager = CookieManager(cookieJar);
|
||||||
dio.interceptors.add(cookieManager);
|
dio.interceptors.add(cookieManager);
|
||||||
final List<Cookie> cookie = await cookieManager.cookieJar
|
var cookie = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
.loadForRequest(Uri.parse(HttpString.baseUrl));
|
||||||
final userInfo = userInfoCache.get('userInfoCache');
|
var userInfo = userInfoCache.get('userInfoCache');
|
||||||
if (userInfo != null && userInfo.mid != null) {
|
if (userInfo != null && userInfo.mid != null) {
|
||||||
final List<Cookie> cookie2 = await cookieManager.cookieJar
|
var cookie2 = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.tUrl));
|
.loadForRequest(Uri.parse(HttpString.tUrl));
|
||||||
if (cookie2.isEmpty) {
|
if (cookie2.isEmpty) {
|
||||||
try {
|
try {
|
||||||
@ -55,22 +50,22 @@ class Request {
|
|||||||
}
|
}
|
||||||
setOptionsHeaders(userInfo, userInfo != null && userInfo.mid != null);
|
setOptionsHeaders(userInfo, userInfo != null && userInfo.mid != null);
|
||||||
|
|
||||||
|
if (cookie.isEmpty) {
|
||||||
try {
|
try {
|
||||||
await buvidActivate();
|
await Request().get(HttpString.baseUrl);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
log("setCookie, ${e.toString()}");
|
log("setCookie, ${e.toString()}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
final String cookieString = cookie
|
var cookieString =
|
||||||
.map((Cookie cookie) => '${cookie.name}=${cookie.value}')
|
cookie.map((cookie) => '${cookie.name}=${cookie.value}').join('; ');
|
||||||
.join('; ');
|
|
||||||
dio.options.headers['cookie'] = cookieString;
|
dio.options.headers['cookie'] = cookieString;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 从cookie中获取 csrf token
|
// 从cookie中获取 csrf token
|
||||||
static Future<String> getCsrf() async {
|
static Future<String> getCsrf() async {
|
||||||
List<Cookie> cookies = await cookieManager.cookieJar
|
var cookies = await cookieManager.cookieJar
|
||||||
.loadForRequest(Uri.parse(HttpString.apiBaseUrl));
|
.loadForRequest(Uri.parse(HttpString.baseApiUrl));
|
||||||
String token = '';
|
String token = '';
|
||||||
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
|
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
|
||||||
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
|
token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
|
||||||
@ -78,45 +73,17 @@ class Request {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
static setOptionsHeaders(userInfo, bool status) {
|
static setOptionsHeaders(userInfo, status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
dio.options.headers['x-bili-mid'] = userInfo.mid.toString();
|
dio.options.headers['x-bili-mid'] = userInfo.mid.toString();
|
||||||
dio.options.headers['x-bili-aurora-eid'] =
|
|
||||||
IdUtils.genAuroraEid(userInfo.mid);
|
|
||||||
}
|
}
|
||||||
dio.options.headers['env'] = 'prod';
|
dio.options.headers['env'] = 'prod';
|
||||||
dio.options.headers['app-key'] = 'android64';
|
dio.options.headers['app-key'] = 'android64';
|
||||||
|
dio.options.headers['x-bili-aurora-eid'] = 'UlMFQVcABlAH';
|
||||||
dio.options.headers['x-bili-aurora-zone'] = 'sh001';
|
dio.options.headers['x-bili-aurora-zone'] = 'sh001';
|
||||||
dio.options.headers['referer'] = 'https://www.bilibili.com/';
|
dio.options.headers['referer'] = 'https://www.bilibili.com/';
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future buvidActivate() async {
|
|
||||||
var html = await Request().get(Api.dynamicSpmPrefix);
|
|
||||||
String spmPrefix = spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
|
||||||
Random rand = Random();
|
|
||||||
String rand_png_end = base64.encode(
|
|
||||||
List<int>.generate(32, (_) => rand.nextInt(256)) +
|
|
||||||
List<int>.filled(4, 0) +
|
|
||||||
[73, 69, 78, 68] +
|
|
||||||
List<int>.generate(4, (_) => rand.nextInt(256))
|
|
||||||
);
|
|
||||||
|
|
||||||
String jsonData = json.encode({
|
|
||||||
'3064': 1,
|
|
||||||
'39c8': '${spmPrefix}.fp.risk',
|
|
||||||
'3c43': {
|
|
||||||
'adca': 'Linux',
|
|
||||||
'bfe9': rand_png_end.substring(rand_png_end.length - 50),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
await Request().post(
|
|
||||||
Api.activateBuvidApi,
|
|
||||||
data: {'payload': jsonData},
|
|
||||||
options: Options(contentType: 'application/json')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* config it and create
|
* config it and create
|
||||||
*/
|
*/
|
||||||
@ -124,7 +91,7 @@ class Request {
|
|||||||
//BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数
|
//BaseOptions、Options、RequestOptions 都可以配置参数,优先级别依次递增,且可以根据优先级别覆盖参数
|
||||||
BaseOptions options = BaseOptions(
|
BaseOptions options = BaseOptions(
|
||||||
//请求基地址,可以包含子路径
|
//请求基地址,可以包含子路径
|
||||||
baseUrl: HttpString.apiBaseUrl,
|
baseUrl: HttpString.baseApiUrl,
|
||||||
//连接服务器超时时间,单位是毫秒.
|
//连接服务器超时时间,单位是毫秒.
|
||||||
connectTimeout: const Duration(milliseconds: 12000),
|
connectTimeout: const Duration(milliseconds: 12000),
|
||||||
//响应流上前后两次接受到数据的间隔,单位为毫秒。
|
//响应流上前后两次接受到数据的间隔,单位为毫秒。
|
||||||
@ -133,40 +100,45 @@ class Request {
|
|||||||
headers: {},
|
headers: {},
|
||||||
);
|
);
|
||||||
|
|
||||||
enableSystemProxy = setting.get(SettingBoxKey.enableSystemProxy,
|
enableSystemProxy =
|
||||||
defaultValue: false) as bool;
|
setting.get(SettingBoxKey.enableSystemProxy, defaultValue: false);
|
||||||
systemProxyHost =
|
systemProxyHost =
|
||||||
localCache.get(LocalCacheKey.systemProxyHost, defaultValue: '');
|
localCache.get(LocalCacheKey.systemProxyHost, defaultValue: '');
|
||||||
systemProxyPort =
|
systemProxyPort =
|
||||||
localCache.get(LocalCacheKey.systemProxyPort, defaultValue: '');
|
localCache.get(LocalCacheKey.systemProxyPort, defaultValue: '');
|
||||||
|
|
||||||
dio = Dio(options);
|
dio = Dio(options)
|
||||||
|
|
||||||
/// fix 第三方登录 302重定向 跟iOS代理问题冲突
|
/// fix 第三方登录 302重定向 跟iOS代理问题冲突
|
||||||
// ..httpClientAdapter = Http2Adapter(
|
..httpClientAdapter = Http2Adapter(
|
||||||
// ConnectionManager(
|
ConnectionManager(
|
||||||
// idleTimeout: const Duration(milliseconds: 10000),
|
idleTimeout: const Duration(milliseconds: 10000),
|
||||||
// onClientCreate: (_, ClientSetting config) =>
|
onClientCreate: (_, config) => config.onBadCertificate = (_) => true,
|
||||||
// config.onBadCertificate = (_) => true,
|
),
|
||||||
// ),
|
)
|
||||||
// );
|
|
||||||
|
|
||||||
/// 设置代理
|
/// 设置代理
|
||||||
if (enableSystemProxy) {
|
..httpClientAdapter = IOHttpClientAdapter(
|
||||||
dio.httpClientAdapter = IOHttpClientAdapter(
|
|
||||||
createHttpClient: () {
|
createHttpClient: () {
|
||||||
final HttpClient client = HttpClient();
|
final client = HttpClient();
|
||||||
// Config the client.
|
// Config the client.
|
||||||
client.findProxy = (Uri uri) {
|
client.findProxy = (uri) {
|
||||||
|
if (enableSystemProxy) {
|
||||||
|
print('🌹:$systemProxyHost');
|
||||||
|
print('🌹:$systemProxyPort');
|
||||||
|
|
||||||
// return 'PROXY host:port';
|
// return 'PROXY host:port';
|
||||||
return 'PROXY $systemProxyHost:$systemProxyPort';
|
return 'PROXY $systemProxyHost:$systemProxyPort';
|
||||||
|
} else {
|
||||||
|
// 不设置代理
|
||||||
|
return 'DIRECT';
|
||||||
|
}
|
||||||
};
|
};
|
||||||
client.badCertificateCallback =
|
client.badCertificateCallback =
|
||||||
(X509Certificate cert, String host, int port) => true;
|
(X509Certificate cert, String host, int port) => true;
|
||||||
return client;
|
return client;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
//添加拦截器
|
//添加拦截器
|
||||||
dio.interceptors.add(ApiInterceptor());
|
dio.interceptors.add(ApiInterceptor());
|
||||||
@ -179,7 +151,7 @@ class Request {
|
|||||||
));
|
));
|
||||||
|
|
||||||
dio.transformer = BackgroundTransformer();
|
dio.transformer = BackgroundTransformer();
|
||||||
dio.options.validateStatus = (int? status) {
|
dio.options.validateStatus = (status) {
|
||||||
return status! >= 200 && status < 300 ||
|
return status! >= 200 && status < 300 ||
|
||||||
HttpString.validateStatusCodes.contains(status);
|
HttpString.validateStatusCodes.contains(status);
|
||||||
};
|
};
|
||||||
@ -190,7 +162,7 @@ class Request {
|
|||||||
*/
|
*/
|
||||||
get(url, {data, options, cancelToken, extra}) async {
|
get(url, {data, options, cancelToken, extra}) async {
|
||||||
Response response;
|
Response response;
|
||||||
final Options options = Options();
|
Options options = Options();
|
||||||
ResponseType resType = ResponseType.json;
|
ResponseType resType = ResponseType.json;
|
||||||
if (extra != null) {
|
if (extra != null) {
|
||||||
resType = extra!['resType'] ?? ResponseType.json;
|
resType = extra!['resType'] ?? ResponseType.json;
|
||||||
@ -209,14 +181,8 @@ class Request {
|
|||||||
);
|
);
|
||||||
return response;
|
return response;
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
Response errResponse = Response(
|
print('get error: $e');
|
||||||
data: {
|
return Future.error(await ApiInterceptor.dioError(e));
|
||||||
'message': await ApiInterceptor.dioError(e)
|
|
||||||
}, // 将自定义 Map 数据赋值给 Response 的 data 属性
|
|
||||||
statusCode: 200,
|
|
||||||
requestOptions: RequestOptions(),
|
|
||||||
);
|
|
||||||
return errResponse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,14 +203,8 @@ class Request {
|
|||||||
// print('post success: ${response.data}');
|
// print('post success: ${response.data}');
|
||||||
return response;
|
return response;
|
||||||
} on DioException catch (e) {
|
} on DioException catch (e) {
|
||||||
Response errResponse = Response(
|
print('post error: $e');
|
||||||
data: {
|
return Future.error(await ApiInterceptor.dioError(e));
|
||||||
'message': await ApiInterceptor.dioError(e)
|
|
||||||
}, // 将自定义 Map 数据赋值给 Response 的 data 属性
|
|
||||||
statusCode: 200,
|
|
||||||
requestOptions: RequestOptions(),
|
|
||||||
);
|
|
||||||
return errResponse;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
// ignore_for_file: avoid_print
|
// ignore_for_file: avoid_print
|
||||||
|
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import '../utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
// import 'package:get/get.dart' hide Response;
|
||||||
|
|
||||||
class ApiInterceptor extends Interceptor {
|
class ApiInterceptor extends Interceptor {
|
||||||
@override
|
@override
|
||||||
@ -20,16 +21,16 @@ class ApiInterceptor extends Interceptor {
|
|||||||
void onResponse(Response response, ResponseInterceptorHandler handler) {
|
void onResponse(Response response, ResponseInterceptorHandler handler) {
|
||||||
try {
|
try {
|
||||||
if (response.statusCode == 302) {
|
if (response.statusCode == 302) {
|
||||||
final List<String> locations = response.headers['location']!;
|
List<String> locations = response.headers['location']!;
|
||||||
if (locations.isNotEmpty) {
|
if (locations.isNotEmpty) {
|
||||||
if (locations.first.startsWith('https://www.mcbbs.net')) {
|
if (locations.first.startsWith('https://www.mcbbs.net')) {
|
||||||
final Uri uri = Uri.parse(locations.first);
|
final uri = Uri.parse(locations.first);
|
||||||
final String? accessKey = uri.queryParameters['access_key'];
|
final accessKey = uri.queryParameters['access_key'];
|
||||||
final String? mid = uri.queryParameters['mid'];
|
final mid = uri.queryParameters['mid'];
|
||||||
try {
|
try {
|
||||||
Box localCache = GStrorage.localCache;
|
Box localCache = GStrorage.localCache;
|
||||||
localCache.put(LocalCacheKey.accessKey,
|
localCache.put(
|
||||||
<String, String?>{'mid': mid, 'value': accessKey});
|
LocalCacheKey.accessKey, {'mid': mid, 'value': accessKey});
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -52,46 +53,47 @@ class ApiInterceptor extends Interceptor {
|
|||||||
super.onError(err, handler);
|
super.onError(err, handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> dioError(DioException error) async {
|
static Future dioError(DioException error) async {
|
||||||
switch (error.type) {
|
switch (error.type) {
|
||||||
case DioExceptionType.badCertificate:
|
case DioExceptionType.badCertificate:
|
||||||
return '证书有误!';
|
return '证书有误!';
|
||||||
case DioExceptionType.badResponse:
|
case DioExceptionType.badResponse:
|
||||||
return '服务器异常,请稍后重试!';
|
return '服务器异常,请稍后重试!';
|
||||||
case DioExceptionType.cancel:
|
case DioExceptionType.cancel:
|
||||||
return '请求已被取消,请重新请求';
|
return "请求已被取消,请重新请求";
|
||||||
case DioExceptionType.connectionError:
|
case DioExceptionType.connectionError:
|
||||||
return '连接错误,请检查网络设置';
|
return '连接错误,请检查网络设置';
|
||||||
case DioExceptionType.connectionTimeout:
|
case DioExceptionType.connectionTimeout:
|
||||||
return '网络连接超时,请检查网络设置';
|
return "网络连接超时,请检查网络设置";
|
||||||
case DioExceptionType.receiveTimeout:
|
case DioExceptionType.receiveTimeout:
|
||||||
return '响应超时,请稍后重试!';
|
return "响应超时,请稍后重试!";
|
||||||
case DioExceptionType.sendTimeout:
|
case DioExceptionType.sendTimeout:
|
||||||
return '发送请求超时,请检查网络设置';
|
return "发送请求超时,请检查网络设置";
|
||||||
case DioExceptionType.unknown:
|
case DioExceptionType.unknown:
|
||||||
final String res = await checkConnect();
|
var res = await checkConect();
|
||||||
return '$res,网络异常!';
|
return res + " \n 网络异常,请稍后重试!";
|
||||||
|
default:
|
||||||
|
return "Dio异常";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> checkConnect() async {
|
static Future<dynamic> checkConect() async {
|
||||||
final ConnectivityResult connectivityResult =
|
final connectivityResult = await (Connectivity().checkConnectivity());
|
||||||
await Connectivity().checkConnectivity();
|
if (connectivityResult == ConnectivityResult.mobile) {
|
||||||
switch (connectivityResult) {
|
return 'connected with mobile network';
|
||||||
case ConnectivityResult.mobile:
|
} else if (connectivityResult == ConnectivityResult.wifi) {
|
||||||
return '正在使用移动流量';
|
return 'connected with wifi network';
|
||||||
case ConnectivityResult.wifi:
|
} else if (connectivityResult == ConnectivityResult.ethernet) {
|
||||||
return '正在使用wifi';
|
// I am connected to a ethernet network.
|
||||||
case ConnectivityResult.ethernet:
|
} else if (connectivityResult == ConnectivityResult.vpn) {
|
||||||
return '正在使用局域网';
|
// I am connected to a vpn network.
|
||||||
case ConnectivityResult.vpn:
|
// Note for iOS and macOS:
|
||||||
return '正在使用代理网络';
|
// There is no separate network interface type for [vpn].
|
||||||
case ConnectivityResult.other:
|
// It returns [other] on any device (also simulator)
|
||||||
return '正在使用其他网络';
|
} else if (connectivityResult == ConnectivityResult.other) {
|
||||||
case ConnectivityResult.none:
|
// I am connected to a network which is not in the above mentioned networks.
|
||||||
return '未连接到任何网络';
|
} else if (connectivityResult == ConnectivityResult.none) {
|
||||||
default:
|
return 'not connected to any network';
|
||||||
return '';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import '../models/live/item.dart';
|
import 'package:pilipala/http/api.dart';
|
||||||
import '../models/live/room_info.dart';
|
import 'package:pilipala/http/init.dart';
|
||||||
import '../models/live/room_info_h5.dart';
|
import 'package:pilipala/models/live/item.dart';
|
||||||
import 'api.dart';
|
import 'package:pilipala/models/live/room_info.dart';
|
||||||
import 'init.dart';
|
|
||||||
|
|
||||||
class LiveHttp {
|
class LiveHttp {
|
||||||
static Future liveList(
|
static Future liveList(
|
||||||
@ -47,22 +46,4 @@ class LiveHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future liveRoomInfoH5({roomId, qn}) async {
|
|
||||||
var res = await Request().get(Api.liveRoomInfoH5, data: {
|
|
||||||
'room_id': roomId,
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': RoomInfoH5Model.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
import 'package:crypto/crypto.dart';
|
import 'package:crypto/crypto.dart';
|
||||||
|
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
import 'package:encrypt/encrypt.dart';
|
import 'package:encrypt/encrypt.dart';
|
||||||
|
import 'package:pilipala/http/index.dart';
|
||||||
|
import 'package:pilipala/models/login/index.dart';
|
||||||
|
import 'package:pilipala/utils/login.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
import '../models/login/index.dart';
|
|
||||||
import '../utils/login.dart';
|
|
||||||
import 'index.dart';
|
|
||||||
|
|
||||||
class LoginHttp {
|
class LoginHttp {
|
||||||
static Future queryCaptcha() async {
|
static Future queryCaptcha() async {
|
||||||
|
@ -1,17 +1,10 @@
|
|||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import 'package:hive/hive.dart';
|
import 'package:pilipala/models/dynamics/result.dart';
|
||||||
import '../common/constants.dart';
|
import 'package:pilipala/models/follow/result.dart';
|
||||||
import '../models/dynamics/result.dart';
|
import 'package:pilipala/models/member/archive.dart';
|
||||||
import '../models/follow/result.dart';
|
import 'package:pilipala/models/member/info.dart';
|
||||||
import '../models/member/archive.dart';
|
import 'package:pilipala/models/member/tags.dart';
|
||||||
import '../models/member/coin.dart';
|
import 'package:pilipala/utils/wbi_sign.dart';
|
||||||
import '../models/member/info.dart';
|
|
||||||
import '../models/member/seasons.dart';
|
|
||||||
import '../models/member/tags.dart';
|
|
||||||
import '../utils/storage.dart';
|
|
||||||
import '../utils/utils.dart';
|
|
||||||
import '../utils/wbi_sign.dart';
|
|
||||||
import 'index.dart';
|
|
||||||
|
|
||||||
class MemberHttp {
|
class MemberHttp {
|
||||||
static Future memberInfo({
|
static Future memberInfo({
|
||||||
@ -79,8 +72,6 @@ class MemberHttp {
|
|||||||
String order = 'pubdate',
|
String order = 'pubdate',
|
||||||
bool orderAvoided = true,
|
bool orderAvoided = true,
|
||||||
}) async {
|
}) async {
|
||||||
String dmImgStr = Utils.base64EncodeRandomString(16, 64);
|
|
||||||
String dmCoverImgStr = Utils.base64EncodeRandomString(32, 128);
|
|
||||||
Map params = await WbiSign().makSign({
|
Map params = await WbiSign().makSign({
|
||||||
'mid': mid,
|
'mid': mid,
|
||||||
'ps': ps,
|
'ps': ps,
|
||||||
@ -90,11 +81,7 @@ class MemberHttp {
|
|||||||
'order': order,
|
'order': order,
|
||||||
'platform': 'web',
|
'platform': 'web',
|
||||||
'web_location': 1550101,
|
'web_location': 1550101,
|
||||||
'order_avoided': orderAvoided,
|
'order_avoided': orderAvoided
|
||||||
'dm_img_list': '[]',
|
|
||||||
'dm_img_str': dmImgStr.substring(0, dmImgStr.length - 2),
|
|
||||||
'dm_cover_img_str': dmCoverImgStr.substring(0, dmCoverImgStr.length - 2),
|
|
||||||
'dm_img_inter': '{"ds":[],"wh":[0,0,0],"of":[0,0,0]}',
|
|
||||||
});
|
});
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.memberArchive,
|
Api.memberArchive,
|
||||||
@ -107,13 +94,10 @@ class MemberHttp {
|
|||||||
'data': MemberArchiveDataModel.fromJson(res.data['data'])
|
'data': MemberArchiveDataModel.fromJson(res.data['data'])
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
Map errMap = {
|
|
||||||
-352: '风控校验失败,请检查登录状态',
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
'status': false,
|
'status': false,
|
||||||
'data': [],
|
'data': [],
|
||||||
'msg': errMap[res.data['code']] ?? res.data['message'],
|
'msg': res.data['message'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -132,13 +116,10 @@ class MemberHttp {
|
|||||||
'data': DynamicsDataModel.fromJson(res.data['data']),
|
'data': DynamicsDataModel.fromJson(res.data['data']),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
Map errMap = {
|
|
||||||
-352: '风控校验失败,请检查登录状态',
|
|
||||||
};
|
|
||||||
return {
|
return {
|
||||||
'status': false,
|
'status': false,
|
||||||
'data': [],
|
'data': [],
|
||||||
'msg': errMap[res.data['code']] ?? res.data['message'],
|
'msg': res.data['message'],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,280 +215,4 @@ class MemberHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取up置顶
|
|
||||||
static Future getTopVideo(String? vmid) async {
|
|
||||||
var res = await Request().get(Api.getTopVideoApi);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data']
|
|
||||||
.map<MemberTagItemModel>((e) => MemberTagItemModel.fromJson(e))
|
|
||||||
.toList()
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取uo专栏
|
|
||||||
static Future getMemberSeasons(int? mid, int? pn, int? ps) async {
|
|
||||||
var res = await Request().get(Api.getMemberSeasonsApi, data: {
|
|
||||||
'mid': mid,
|
|
||||||
'page_num': pn,
|
|
||||||
'page_size': ps,
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': MemberSeasonsDataModel.fromJson(res.data['data']['items_lists'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 最近投币
|
|
||||||
static Future getRecentCoinVideo({required int mid}) async {
|
|
||||||
Map params = await WbiSign().makSign({
|
|
||||||
'mid': mid,
|
|
||||||
'gaia_source': 'main_web',
|
|
||||||
'web_location': 333.999,
|
|
||||||
});
|
|
||||||
var res = await Request().get(
|
|
||||||
Api.getRecentCoinVideoApi,
|
|
||||||
data: {
|
|
||||||
'vmid': mid,
|
|
||||||
'gaia_source': 'main_web',
|
|
||||||
'web_location': 333.999,
|
|
||||||
'w_rid': params['w_rid'],
|
|
||||||
'wts': params['wts'],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data']
|
|
||||||
.map<MemberCoinsDataModel>((e) => MemberCoinsDataModel.fromJson(e))
|
|
||||||
.toList(),
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 最近点赞
|
|
||||||
static Future getRecentLikeVideo({required int mid}) async {
|
|
||||||
Map params = await WbiSign().makSign({
|
|
||||||
'mid': mid,
|
|
||||||
'gaia_source': 'main_web',
|
|
||||||
'web_location': 333.999,
|
|
||||||
});
|
|
||||||
var res = await Request().get(
|
|
||||||
Api.getRecentLikeVideoApi,
|
|
||||||
data: {
|
|
||||||
'vmid': mid,
|
|
||||||
'gaia_source': 'main_web',
|
|
||||||
'web_location': 333.999,
|
|
||||||
'w_rid': params['w_rid'],
|
|
||||||
'wts': params['wts'],
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': MemberSeasonsDataModel.fromJson(res.data['data']['items_lists'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查看某个专栏
|
|
||||||
static Future getSeasonDetail({
|
|
||||||
required int mid,
|
|
||||||
required int seasonId,
|
|
||||||
bool sortReverse = false,
|
|
||||||
required int pn,
|
|
||||||
required int ps,
|
|
||||||
}) async {
|
|
||||||
var res = await Request().get(
|
|
||||||
Api.getSeasonDetailApi,
|
|
||||||
data: {
|
|
||||||
'mid': mid,
|
|
||||||
'season_id': seasonId,
|
|
||||||
'sort_reverse': sortReverse,
|
|
||||||
'page_num': pn,
|
|
||||||
'page_size': ps,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
try {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': MemberSeasonsList.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
print(err);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取TV authCode
|
|
||||||
static Future getTVCode() async {
|
|
||||||
SmartDialog.showLoading();
|
|
||||||
var params = {
|
|
||||||
'appkey': Constants.appKey,
|
|
||||||
'local_id': '0',
|
|
||||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
|
||||||
};
|
|
||||||
String sign = Utils.appSign(
|
|
||||||
params,
|
|
||||||
Constants.appKey,
|
|
||||||
Constants.appSec,
|
|
||||||
);
|
|
||||||
var res = await Request()
|
|
||||||
.post(Api.getTVCode, queryParameters: {...params, 'sign': sign});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data']['auth_code'],
|
|
||||||
'msg': '操作成功'
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取access_key
|
|
||||||
static Future cookieToKey() async {
|
|
||||||
var authCodeRes = await getTVCode();
|
|
||||||
if (authCodeRes['status']) {
|
|
||||||
var res = await Request().post(Api.cookieToKey, queryParameters: {
|
|
||||||
'auth_code': authCodeRes['data'],
|
|
||||||
'build': 708200,
|
|
||||||
'csrf': await Request.getCsrf(),
|
|
||||||
});
|
|
||||||
await Future.delayed(const Duration(milliseconds: 300));
|
|
||||||
await qrcodePoll(authCodeRes['data']);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future qrcodePoll(authCode) async {
|
|
||||||
var params = {
|
|
||||||
'appkey': Constants.appKey,
|
|
||||||
'auth_code': authCode.toString(),
|
|
||||||
'local_id': '0',
|
|
||||||
'ts': (DateTime.now().millisecondsSinceEpoch ~/ 1000).toString(),
|
|
||||||
};
|
|
||||||
String sign = Utils.appSign(
|
|
||||||
params,
|
|
||||||
Constants.appKey,
|
|
||||||
Constants.appSec,
|
|
||||||
);
|
|
||||||
var res = await Request()
|
|
||||||
.post(Api.qrcodePoll, queryParameters: {...params, 'sign': sign});
|
|
||||||
SmartDialog.dismiss();
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
String accessKey = res.data['data']['access_token'];
|
|
||||||
Box localCache = GStrorage.localCache;
|
|
||||||
Box userInfoCache = GStrorage.userInfo;
|
|
||||||
var userInfo = userInfoCache.get('userInfoCache');
|
|
||||||
localCache.put(
|
|
||||||
LocalCacheKey.accessKey, {'mid': userInfo.mid, 'value': accessKey});
|
|
||||||
return {'status': true, 'data': [], 'msg': '操作成功'};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取up播放数、点赞数
|
|
||||||
static Future memberView({required int mid}) async {
|
|
||||||
var res = await Request().get(Api.getMemberViewApi, data: {'mid': mid});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {'status': true, 'data': res.data['data']};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 搜索follow
|
|
||||||
static Future getfollowSearch({
|
|
||||||
required int mid,
|
|
||||||
required int ps,
|
|
||||||
required int pn,
|
|
||||||
required String name,
|
|
||||||
}) async {
|
|
||||||
Map<String, dynamic> data = {
|
|
||||||
'vmid': mid,
|
|
||||||
'pn': pn,
|
|
||||||
'ps': ps,
|
|
||||||
'order': 'desc',
|
|
||||||
'order_type': 'attention',
|
|
||||||
'gaia_source': 'main_web',
|
|
||||||
'name': name,
|
|
||||||
'web_location': 333.999,
|
|
||||||
};
|
|
||||||
Map params = await WbiSign().makSign(data);
|
|
||||||
var res = await Request().get(Api.followSearch, data: {
|
|
||||||
...data,
|
|
||||||
'w_rid': params['w_rid'],
|
|
||||||
'wts': params['wts'],
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': FollowDataModel.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'data': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,223 +0,0 @@
|
|||||||
import 'dart:math';
|
|
||||||
import '../models/msg/account.dart';
|
|
||||||
import '../models/msg/session.dart';
|
|
||||||
import '../utils/wbi_sign.dart';
|
|
||||||
import 'api.dart';
|
|
||||||
import 'init.dart';
|
|
||||||
|
|
||||||
class MsgHttp {
|
|
||||||
// 会话列表
|
|
||||||
static Future sessionList({int? endTs}) async {
|
|
||||||
Map<String, dynamic> params = {
|
|
||||||
'session_type': 1,
|
|
||||||
'group_fold': 1,
|
|
||||||
'unfollow_fold': 0,
|
|
||||||
'sort_rule': 2,
|
|
||||||
'build': 0,
|
|
||||||
'mobi_app': 'web',
|
|
||||||
};
|
|
||||||
if (endTs != null) {
|
|
||||||
params['end_ts'] = endTs;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map signParams = await WbiSign().makSign(params);
|
|
||||||
var res = await Request().get(Api.sessionList, data: signParams);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
try {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': SessionDataModel.fromJson(res.data['data']),
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': err.toString(),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future accountList(uids) async {
|
|
||||||
var res = await Request().get(Api.sessionAccountList, data: {
|
|
||||||
'uids': uids,
|
|
||||||
'build': 0,
|
|
||||||
'mobi_app': 'web',
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
try {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data']
|
|
||||||
.map<AccountListModel>((e) => AccountListModel.fromJson(e))
|
|
||||||
.toList(),
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
print('err🔟: $err');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future sessionMsg({
|
|
||||||
int? talkerId,
|
|
||||||
}) async {
|
|
||||||
Map params = await WbiSign().makSign({
|
|
||||||
'talker_id': talkerId,
|
|
||||||
'session_type': 1,
|
|
||||||
'size': 20,
|
|
||||||
'sender_device_id': 1,
|
|
||||||
'build': 0,
|
|
||||||
'mobi_app': 'web',
|
|
||||||
});
|
|
||||||
var res = await Request().get(Api.sessionMsg, data: params);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
try {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': SessionMsgDataModel.fromJson(res.data['data']),
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
print(err);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 消息标记已读
|
|
||||||
static Future ackSessionMsg({
|
|
||||||
int? talkerId,
|
|
||||||
int? ackSeqno,
|
|
||||||
}) async {
|
|
||||||
String csrf = await Request.getCsrf();
|
|
||||||
Map params = await WbiSign().makSign({
|
|
||||||
'talker_id': talkerId,
|
|
||||||
'session_type': 1,
|
|
||||||
'ack_seqno': ackSeqno,
|
|
||||||
'build': 0,
|
|
||||||
'mobi_app': 'web',
|
|
||||||
'csrf_token': csrf,
|
|
||||||
'csrf': csrf
|
|
||||||
});
|
|
||||||
var res = await Request().get(Api.ackSessionMsg, data: params);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data'],
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': "message: ${res.data['message']},"
|
|
||||||
" msg: ${res.data['msg']},"
|
|
||||||
" code: ${res.data['code']}",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 发送私信
|
|
||||||
static Future sendMsg({
|
|
||||||
int? senderUid,
|
|
||||||
int? receiverId,
|
|
||||||
int? receiverType,
|
|
||||||
int? msgType,
|
|
||||||
dynamic content,
|
|
||||||
}) async {
|
|
||||||
String csrf = await Request.getCsrf();
|
|
||||||
Map<String, dynamic> params = await WbiSign().makSign({
|
|
||||||
'msg[sender_uid]': senderUid,
|
|
||||||
'msg[receiver_id]': receiverId,
|
|
||||||
'msg[receiver_type]': receiverType ?? 1,
|
|
||||||
'msg[msg_type]': msgType ?? 1,
|
|
||||||
'msg[msg_status]': 0,
|
|
||||||
'msg[dev_id]': getDevId(),
|
|
||||||
'msg[timestamp]': DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
|
||||||
'msg[new_face_version]': 0,
|
|
||||||
'msg[content]': content,
|
|
||||||
'from_firework': 0,
|
|
||||||
'build': 0,
|
|
||||||
'mobi_app': 'web',
|
|
||||||
'csrf_token': csrf,
|
|
||||||
'csrf': csrf,
|
|
||||||
});
|
|
||||||
var res =
|
|
||||||
await Request().post(Api.sendMsg, queryParameters: <String, dynamic>{
|
|
||||||
...params,
|
|
||||||
'csrf_token': csrf,
|
|
||||||
'csrf': csrf,
|
|
||||||
}, data: {
|
|
||||||
'w_sender_uid': params['msg[sender_uid]'],
|
|
||||||
'w_receiver_id': params['msg[receiver_id]'],
|
|
||||||
'w_dev_id': params['msg[dev_id]'],
|
|
||||||
'w_rid': params['w_rid'],
|
|
||||||
'wts': params['wts'],
|
|
||||||
'csrf_token': csrf,
|
|
||||||
'csrf': csrf,
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': res.data['data'],
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': "message: ${res.data['message']},"
|
|
||||||
" msg: ${res.data['msg']},"
|
|
||||||
" code: ${res.data['code']}",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static String getDevId() {
|
|
||||||
final List<String> b = [
|
|
||||||
'0',
|
|
||||||
'1',
|
|
||||||
'2',
|
|
||||||
'3',
|
|
||||||
'4',
|
|
||||||
'5',
|
|
||||||
'6',
|
|
||||||
'7',
|
|
||||||
'8',
|
|
||||||
'9',
|
|
||||||
'A',
|
|
||||||
'B',
|
|
||||||
'C',
|
|
||||||
'D',
|
|
||||||
'E',
|
|
||||||
'F'
|
|
||||||
];
|
|
||||||
final List<String> s = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".split('');
|
|
||||||
for (int i = 0; i < s.length; i++) {
|
|
||||||
if ('-' == s[i] || '4' == s[i]) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
final int randomInt = Random().nextInt(16);
|
|
||||||
if ('x' == s[i]) {
|
|
||||||
s[i] = b[randomInt];
|
|
||||||
} else {
|
|
||||||
s[i] = b[3 & randomInt | 8];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return s.join();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +1,6 @@
|
|||||||
import '../models/video/reply/data.dart';
|
import 'package:pilipala/http/api.dart';
|
||||||
import '../models/video/reply/emote.dart';
|
import 'package:pilipala/http/init.dart';
|
||||||
import 'api.dart';
|
import 'package:pilipala/models/video/reply/data.dart';
|
||||||
import 'init.dart';
|
|
||||||
|
|
||||||
class ReplyHttp {
|
class ReplyHttp {
|
||||||
static Future replyList({
|
static Future replyList({
|
||||||
@ -101,23 +100,4 @@ class ReplyHttp {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future getEmoteList({String? business}) async {
|
|
||||||
var res = await Request().get(Api.emojiList, data: {
|
|
||||||
'business': business ?? 'reply',
|
|
||||||
'web_location': '333.1245',
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': EmoteModelData.fromJson(res.data['data']),
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {
|
|
||||||
'status': false,
|
|
||||||
'date': [],
|
|
||||||
'msg': res.data['message'],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import '../models/bangumi/info.dart';
|
import 'package:pilipala/http/index.dart';
|
||||||
import '../models/common/search_type.dart';
|
import 'package:pilipala/models/bangumi/info.dart';
|
||||||
import '../models/search/hot.dart';
|
import 'package:pilipala/models/common/search_type.dart';
|
||||||
import '../models/search/result.dart';
|
import 'package:pilipala/models/search/hot.dart';
|
||||||
import '../models/search/suggest.dart';
|
import 'package:pilipala/models/search/result.dart';
|
||||||
import '../utils/storage.dart';
|
import 'package:pilipala/models/search/suggest.dart';
|
||||||
import 'index.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
class SearchHttp {
|
class SearchHttp {
|
||||||
static Box setting = GStrorage.setting;
|
static Box setting = GStrorage.setting;
|
||||||
@ -36,7 +37,7 @@ class SearchHttp {
|
|||||||
|
|
||||||
// 获取搜索建议
|
// 获取搜索建议
|
||||||
static Future searchSuggest({required term}) async {
|
static Future searchSuggest({required term}) async {
|
||||||
var res = await Request().get(Api.searchSuggest,
|
var res = await Request().get(Api.serachSuggest,
|
||||||
data: {'term': term, 'main_ver': 'v1', 'highlight': term});
|
data: {'term': term, 'main_ver': 'v1', 'highlight': term});
|
||||||
if (res.data is String) {
|
if (res.data is String) {
|
||||||
Map<String, dynamic> resultMap = json.decode(res.data);
|
Map<String, dynamic> resultMap = json.decode(res.data);
|
||||||
@ -128,28 +129,25 @@ class SearchHttp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<int> ab2c({int? aid, String? bvid}) async {
|
static Future ab2c({int? aid, String? bvid}) async {
|
||||||
Map<String, dynamic> data = {};
|
Map<String, dynamic> data = {};
|
||||||
if (aid != null) {
|
if (aid != null) {
|
||||||
data['aid'] = aid;
|
data['aid'] = aid;
|
||||||
} else if (bvid != null) {
|
} else if (bvid != null) {
|
||||||
data['bvid'] = bvid;
|
data['bvid'] = bvid;
|
||||||
}
|
}
|
||||||
final dynamic res =
|
var res = await Request().get(Api.ab2c, data: {...data});
|
||||||
await Request().get(Api.ab2c, data: <String, dynamic>{...data});
|
|
||||||
return res.data['data'].first['cid'];
|
return res.data['data'].first['cid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<Map<String, dynamic>> bangumiInfo(
|
static Future bangumiInfo({int? seasonId, int? epId}) async {
|
||||||
{int? seasonId, int? epId}) async {
|
Map<String, dynamic> data = {};
|
||||||
final Map<String, dynamic> data = {};
|
|
||||||
if (seasonId != null) {
|
if (seasonId != null) {
|
||||||
data['season_id'] = seasonId;
|
data['season_id'] = seasonId;
|
||||||
} else if (epId != null) {
|
} else if (epId != null) {
|
||||||
data['ep_id'] = epId;
|
data['ep_id'] = epId;
|
||||||
}
|
}
|
||||||
final dynamic res =
|
var res = await Request().get(Api.bangumiInfo, data: {...data});
|
||||||
await Request().get(Api.bangumiInfo, data: <String, dynamic>{...data});
|
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
|
@ -1,15 +1,14 @@
|
|||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import '../common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import '../models/model_hot_video_item.dart';
|
import 'package:pilipala/http/api.dart';
|
||||||
import '../models/user/fav_detail.dart';
|
import 'package:pilipala/http/init.dart';
|
||||||
import '../models/user/fav_folder.dart';
|
import 'package:pilipala/models/model_hot_video_item.dart';
|
||||||
import '../models/user/history.dart';
|
import 'package:pilipala/models/user/fav_detail.dart';
|
||||||
import '../models/user/info.dart';
|
import 'package:pilipala/models/user/fav_folder.dart';
|
||||||
import '../models/user/stat.dart';
|
import 'package:pilipala/models/user/history.dart';
|
||||||
import '../models/user/sub_detail.dart';
|
import 'package:pilipala/models/user/info.dart';
|
||||||
import '../models/user/sub_folder.dart';
|
import 'package:pilipala/models/user/stat.dart';
|
||||||
import 'api.dart';
|
import 'package:pilipala/utils/wbi_sign.dart';
|
||||||
import 'init.dart';
|
|
||||||
|
|
||||||
class UserHttp {
|
class UserHttp {
|
||||||
static Future<dynamic> userStat({required int mid}) async {
|
static Future<dynamic> userStat({required int mid}) async {
|
||||||
@ -200,7 +199,7 @@ class UserHttp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户凭证 失效
|
// 获取用户凭证
|
||||||
static Future thirdLogin() async {
|
static Future thirdLogin() async {
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
'https://passport.bilibili.com/login/app/third',
|
'https://passport.bilibili.com/login/app/third',
|
||||||
@ -252,43 +251,30 @@ class UserHttp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future hasFollow(int mid) async {
|
// 相互关系查询
|
||||||
|
static Future relationSearch(int mid) async {
|
||||||
|
Map params = await WbiSign().makSign({
|
||||||
|
'mid': mid,
|
||||||
|
'token': '',
|
||||||
|
'platform': 'web',
|
||||||
|
'web_location': 1550101,
|
||||||
|
});
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.hasFollow,
|
Api.relationSearch,
|
||||||
data: {
|
data: {
|
||||||
'fid': mid,
|
'mid': mid,
|
||||||
|
'w_rid': params['w_rid'],
|
||||||
|
'wts': params['wts'],
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
|
// relation 主动状态
|
||||||
|
// 被动状态
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// // 相互关系查询
|
|
||||||
// static Future relationSearch(int mid) async {
|
|
||||||
// Map params = await WbiSign().makSign({
|
|
||||||
// 'mid': mid,
|
|
||||||
// 'token': '',
|
|
||||||
// 'platform': 'web',
|
|
||||||
// 'web_location': 1550101,
|
|
||||||
// });
|
|
||||||
// var res = await Request().get(
|
|
||||||
// Api.relationSearch,
|
|
||||||
// data: {
|
|
||||||
// 'mid': mid,
|
|
||||||
// 'w_rid': params['w_rid'],
|
|
||||||
// 'wts': params['wts'],
|
|
||||||
// },
|
|
||||||
// );
|
|
||||||
// if (res.data['code'] == 0) {
|
|
||||||
// // relation 主动状态
|
|
||||||
// // 被动状态
|
|
||||||
// return {'status': true, 'data': res.data['data']};
|
|
||||||
// } else {
|
|
||||||
// return {'status': false, 'msg': res.data['message']};
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 搜索历史记录
|
// 搜索历史记录
|
||||||
static Future searchHistory(
|
static Future searchHistory(
|
||||||
@ -307,63 +293,4 @@ class UserHttp {
|
|||||||
return {'status': false, 'msg': res.data['message']};
|
return {'status': false, 'msg': res.data['message']};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 我的订阅
|
|
||||||
static Future userSubFolder({
|
|
||||||
required int mid,
|
|
||||||
required int pn,
|
|
||||||
required int ps,
|
|
||||||
}) async {
|
|
||||||
var res = await Request().get(Api.userSubFolder, data: {
|
|
||||||
'up_mid': mid,
|
|
||||||
'ps': ps,
|
|
||||||
'pn': pn,
|
|
||||||
'platform': 'web',
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': SubFolderModelData.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {'status': false, 'msg': res.data['message']};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static Future userSubFolderDetail({
|
|
||||||
required int seasonId,
|
|
||||||
required int pn,
|
|
||||||
required int ps,
|
|
||||||
}) async {
|
|
||||||
var res = await Request().get(Api.userSubFolderDetail, data: {
|
|
||||||
'season_id': seasonId,
|
|
||||||
'ps': ps,
|
|
||||||
'pn': pn,
|
|
||||||
});
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {
|
|
||||||
'status': true,
|
|
||||||
'data': SubDetailModelData.fromJson(res.data['data'])
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return {'status': false, 'msg': res.data['message']};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消订阅
|
|
||||||
static Future userSubCancel({required int seasonId}) async {
|
|
||||||
var res = await Request().post(
|
|
||||||
Api.userSubCancel,
|
|
||||||
queryParameters: {
|
|
||||||
'season_id': seasonId,
|
|
||||||
'platform': 'web',
|
|
||||||
'csrf': await Request.getCsrf(),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (res.data['code'] == 0) {
|
|
||||||
return {'status': true, 'msg': '取消订阅成功'};
|
|
||||||
} else {
|
|
||||||
return {'status': false, 'msg': res.data['message']};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import '../common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import '../models/common/reply_type.dart';
|
import 'package:pilipala/http/api.dart';
|
||||||
import '../models/home/rcmd/result.dart';
|
import 'package:pilipala/http/init.dart';
|
||||||
import '../models/model_hot_video_item.dart';
|
import 'package:pilipala/models/common/reply_type.dart';
|
||||||
import '../models/model_rec_video_item.dart';
|
import 'package:pilipala/models/home/rcmd/result.dart';
|
||||||
import '../models/user/fav_folder.dart';
|
import 'package:pilipala/models/model_hot_video_item.dart';
|
||||||
import '../models/video/ai.dart';
|
import 'package:pilipala/models/model_rec_video_item.dart';
|
||||||
import '../models/video/play/url.dart';
|
import 'package:pilipala/models/user/fav_folder.dart';
|
||||||
import '../models/video_detail_res.dart';
|
import 'package:pilipala/models/video/ai.dart';
|
||||||
import '../utils/recommend_filter.dart';
|
import 'package:pilipala/models/video/play/url.dart';
|
||||||
import '../utils/storage.dart';
|
import 'package:pilipala/models/video_detail_res.dart';
|
||||||
import '../utils/wbi_sign.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'api.dart';
|
import 'package:pilipala/utils/wbi_sign.dart';
|
||||||
import 'init.dart';
|
|
||||||
|
|
||||||
/// res.data['code'] == 0 请求正常返回结果
|
/// res.data['code'] == 0 请求正常返回结果
|
||||||
/// res.data['data'] 为结果
|
/// res.data['data'] 为结果
|
||||||
@ -30,44 +30,30 @@ class VideoHttp {
|
|||||||
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
|
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
|
||||||
try {
|
try {
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.recommendListWeb,
|
Api.recommendList,
|
||||||
data: {
|
data: {
|
||||||
'version': 1,
|
'version': 1,
|
||||||
'feed_version': 'V8',
|
'feed_version': 'V3',
|
||||||
'homepage_ver': 1,
|
|
||||||
'ps': ps,
|
'ps': ps,
|
||||||
'fresh_idx': freshIdx,
|
'fresh_idx': freshIdx,
|
||||||
'brush': freshIdx,
|
'fresh_type': 999999
|
||||||
'fresh_type': 4
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
List<RecVideoItemModel> list = [];
|
List<RecVideoItemModel> list = [];
|
||||||
List<int> blackMidsList =
|
|
||||||
setting.get(SettingBoxKey.blackMidsList, defaultValue: [-1]);
|
|
||||||
for (var i in res.data['data']['item']) {
|
for (var i in res.data['data']['item']) {
|
||||||
//过滤掉live与ad,以及拉黑用户
|
list.add(RecVideoItemModel.fromJson(i));
|
||||||
if (i['goto'] == 'av' &&
|
|
||||||
(i['owner'] != null &&
|
|
||||||
!blackMidsList.contains(i['owner']['mid']))) {
|
|
||||||
RecVideoItemModel videoItem = RecVideoItemModel.fromJson(i);
|
|
||||||
if (!RecommendFilter.filter(videoItem)) {
|
|
||||||
list.add(videoItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {'status': true, 'data': list};
|
return {'status': true, 'data': list};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
return {'status': false, 'data': [], 'msg': ''};
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {'status': false, 'data': [], 'msg': err.toString()};
|
return {'status': false, 'data': [], 'msg': err.toString()};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加额外的loginState变量模拟未登录状态
|
static Future rcmdVideoListApp({int? ps, required int freshIdx}) async {
|
||||||
static Future rcmdVideoListApp(
|
|
||||||
{bool loginStatus = true, required int freshIdx}) async {
|
|
||||||
try {
|
try {
|
||||||
var res = await Request().get(
|
var res = await Request().get(
|
||||||
Api.recommendListApp,
|
Api.recommendListApp,
|
||||||
@ -80,11 +66,9 @@ class VideoHttp {
|
|||||||
'device_name': 'vivo',
|
'device_name': 'vivo',
|
||||||
'pull': freshIdx == 0 ? 'true' : 'false',
|
'pull': freshIdx == 0 ? 'true' : 'false',
|
||||||
'appkey': Constants.appKey,
|
'appkey': Constants.appKey,
|
||||||
'access_key': loginStatus
|
'access_key': localCache
|
||||||
? (localCache.get(LocalCacheKey.accessKey,
|
.get(LocalCacheKey.accessKey, defaultValue: {})['value'] ??
|
||||||
defaultValue: {})['value'] ??
|
''
|
||||||
'')
|
|
||||||
: ''
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
@ -97,15 +81,12 @@ class VideoHttp {
|
|||||||
(!enableRcmdDynamic ? i['card_goto'] != 'picture' : true) &&
|
(!enableRcmdDynamic ? i['card_goto'] != 'picture' : true) &&
|
||||||
(i['args'] != null &&
|
(i['args'] != null &&
|
||||||
!blackMidsList.contains(i['args']['up_mid']))) {
|
!blackMidsList.contains(i['args']['up_mid']))) {
|
||||||
RecVideoItemAppModel videoItem = RecVideoItemAppModel.fromJson(i);
|
list.add(RecVideoItemAppModel.fromJson(i));
|
||||||
if (!RecommendFilter.filter(videoItem)) {
|
|
||||||
list.add(videoItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {'status': true, 'data': list};
|
return {'status': true, 'data': list};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
return {'status': false, 'data': [], 'msg': ''};
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {'status': false, 'data': [], 'msg': err.toString()};
|
return {'status': false, 'data': [], 'msg': err.toString()};
|
||||||
@ -130,7 +111,7 @@ class VideoHttp {
|
|||||||
}
|
}
|
||||||
return {'status': true, 'data': list};
|
return {'status': true, 'data': list};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
return {'status': false, 'data': []};
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return {'status': false, 'data': [], 'msg': err};
|
return {'status': false, 'data': [], 'msg': err};
|
||||||
@ -141,34 +122,27 @@ class VideoHttp {
|
|||||||
static Future videoUrl(
|
static Future videoUrl(
|
||||||
{int? avid, String? bvid, required int cid, int? qn}) async {
|
{int? avid, String? bvid, required int cid, int? qn}) async {
|
||||||
Map<String, dynamic> data = {
|
Map<String, dynamic> data = {
|
||||||
|
// 'avid': avid,
|
||||||
|
'bvid': bvid,
|
||||||
'cid': cid,
|
'cid': cid,
|
||||||
'qn': qn ?? 80,
|
// 'qn': qn ?? 80,
|
||||||
// 获取所有格式的视频
|
// 获取所有格式的视频
|
||||||
'fnval': 4048,
|
'fnval': 4048,
|
||||||
|
// 'fnver': '',
|
||||||
|
'fourk': 1,
|
||||||
|
// 'session': '',
|
||||||
|
// 'otype': '',
|
||||||
|
// 'type': '',
|
||||||
|
// 'platform': '',
|
||||||
|
// 'high_quality': ''
|
||||||
};
|
};
|
||||||
if (avid != null) {
|
|
||||||
data['avid'] = avid;
|
|
||||||
}
|
|
||||||
if (bvid != null) {
|
|
||||||
data['bvid'] = bvid;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 免登录查看1080p
|
// 免登录查看1080p
|
||||||
if (userInfoCache.get('userInfoCache') == null &&
|
if (userInfoCache.get('userInfoCache') == null &&
|
||||||
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
|
setting.get(SettingBoxKey.p1080, defaultValue: true)) {
|
||||||
data['try_look'] = 1;
|
data['try_look'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map params = await WbiSign().makSign({
|
|
||||||
...data,
|
|
||||||
'fourk': 1,
|
|
||||||
'voice_balance': 1,
|
|
||||||
'gaia_source': 'pre-load',
|
|
||||||
'web_location': 1550101,
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var res = await Request().get(Api.videoUrl, data: params);
|
var res = await Request().get(Api.videoUrl, data: data);
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
@ -216,10 +190,7 @@ class VideoHttp {
|
|||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
List<HotVideoItemModel> list = [];
|
List<HotVideoItemModel> list = [];
|
||||||
for (var i in res.data['data']) {
|
for (var i in res.data['data']) {
|
||||||
HotVideoItemModel videoItem = HotVideoItemModel.fromJson(i);
|
list.add(HotVideoItemModel.fromJson(i));
|
||||||
if (!RecommendFilter.filter(videoItem, relatedVideos: true)) {
|
|
||||||
list.add(videoItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return {'status': true, 'data': list};
|
return {'status': true, 'data': list};
|
||||||
} else {
|
} else {
|
||||||
@ -240,11 +211,10 @@ class VideoHttp {
|
|||||||
// 获取投币状态
|
// 获取投币状态
|
||||||
static Future hasCoinVideo({required String bvid}) async {
|
static Future hasCoinVideo({required String bvid}) async {
|
||||||
var res = await Request().get(Api.hasCoinVideo, data: {'bvid': bvid});
|
var res = await Request().get(Api.hasCoinVideo, data: {'bvid': bvid});
|
||||||
print('res: $res');
|
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': []};
|
return {'status': true, 'data': []};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +292,7 @@ class VideoHttp {
|
|||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': [], 'msg': res.data['message']};
|
return {'status': false, 'data': []};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +348,7 @@ class VideoHttp {
|
|||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': []};
|
return {'status': true, 'data': []};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +364,7 @@ class VideoHttp {
|
|||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
} else {
|
||||||
return {'status': false, 'data': []};
|
return {'status': true, 'data': []};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -450,8 +420,6 @@ class VideoHttp {
|
|||||||
});
|
});
|
||||||
if (res.data['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {'status': true, 'data': res.data['data']};
|
return {'status': true, 'data': res.data['data']};
|
||||||
} else {
|
|
||||||
return {'status': false, 'data': null, 'msg': res.data['message']};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -466,13 +434,11 @@ class VideoHttp {
|
|||||||
'up_mid': upMid,
|
'up_mid': upMid,
|
||||||
});
|
});
|
||||||
var res = await Request().get(Api.aiConclusion, data: params);
|
var res = await Request().get(Api.aiConclusion, data: params);
|
||||||
if (res.data['code'] == 0 && res.data['data']['code'] == 0) {
|
if (res.data['code'] == 0) {
|
||||||
return {
|
return {
|
||||||
'status': true,
|
'status': true,
|
||||||
'data': AiConclusionModel.fromJson(res.data['data']),
|
'data': AiConclusionModel.fromJson(res.data['data']),
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
return {'status': false, 'data': []};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
102
lib/main.dart
@ -1,5 +1,9 @@
|
|||||||
|
<<<<<<< HEAD
|
||||||
|
import 'package:audio_service/audio_service.dart';
|
||||||
|
=======
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
>>>>>>> main
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
import 'package:flutter_displaymode/flutter_displaymode.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
@ -21,9 +25,6 @@ import 'package:pilipala/utils/app_scheme.dart';
|
|||||||
import 'package:pilipala/utils/data.dart';
|
import 'package:pilipala/utils/data.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:media_kit/media_kit.dart'; // Provides [Player], [Media], [Playlist] etc.
|
import 'package:media_kit/media_kit.dart'; // Provides [Player], [Media], [Playlist] etc.
|
||||||
import 'package:pilipala/utils/recommend_filter.dart';
|
|
||||||
import 'package:catcher_2/catcher_2.dart';
|
|
||||||
import './services/loggeer.dart';
|
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
@ -32,36 +33,23 @@ void main() async {
|
|||||||
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown])
|
[DeviceOrientation.portraitUp, DeviceOrientation.portraitDown])
|
||||||
.then((_) async {
|
.then((_) async {
|
||||||
await GStrorage.init();
|
await GStrorage.init();
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
|
await AudioService.init<AudioHandler>(
|
||||||
|
builder: () => MyAudioHandler(),
|
||||||
|
config: const AudioServiceConfig(
|
||||||
|
androidNotificationChannelId: 'com.guozhigq.pilipala.channel.audio',
|
||||||
|
androidNotificationChannelName: 'Music playback',
|
||||||
|
androidNotificationOngoing: true,
|
||||||
|
androidStopForegroundOnPause: true,
|
||||||
|
androidNotificationIcon: 'drawable/audio_service_icon',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
=======
|
||||||
await setupServiceLocator();
|
await setupServiceLocator();
|
||||||
Request();
|
>>>>>>> main
|
||||||
await Request.setCookie();
|
|
||||||
RecommendFilter();
|
|
||||||
|
|
||||||
// 异常捕获 logo记录
|
|
||||||
final Catcher2Options debugConfig = Catcher2Options(
|
|
||||||
SilentReportMode(),
|
|
||||||
[
|
|
||||||
FileHandler(await getLogsPath()),
|
|
||||||
ConsoleHandler(
|
|
||||||
enableDeviceParameters: false,
|
|
||||||
enableApplicationParameters: false,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
);
|
|
||||||
|
|
||||||
final Catcher2Options releaseConfig = Catcher2Options(
|
|
||||||
SilentReportMode(),
|
|
||||||
[FileHandler(await getLogsPath())],
|
|
||||||
);
|
|
||||||
|
|
||||||
Catcher2(
|
|
||||||
debugConfig: debugConfig,
|
|
||||||
releaseConfig: releaseConfig,
|
|
||||||
runAppFunction: () {
|
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// 小白条、导航栏沉浸
|
// 小白条、导航栏沉浸
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
|
||||||
@ -69,7 +57,9 @@ void main() async {
|
|||||||
systemNavigationBarDividerColor: Colors.transparent,
|
systemNavigationBarDividerColor: Colors.transparent,
|
||||||
statusBarColor: Colors.transparent,
|
statusBarColor: Colors.transparent,
|
||||||
));
|
));
|
||||||
|
await Request.setCookie();
|
||||||
Data.init();
|
Data.init();
|
||||||
|
GStrorage.lazyInit();
|
||||||
PiliSchame.init();
|
PiliSchame.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -141,13 +131,6 @@ class MyApp extends StatelessWidget {
|
|||||||
? darkColorScheme
|
? darkColorScheme
|
||||||
: lightColorScheme,
|
: lightColorScheme,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
snackBarTheme: SnackBarThemeData(
|
|
||||||
actionTextColor: lightColorScheme.primary,
|
|
||||||
backgroundColor: lightColorScheme.secondaryContainer,
|
|
||||||
closeIconColor: lightColorScheme.secondary,
|
|
||||||
contentTextStyle: TextStyle(color: lightColorScheme.secondary),
|
|
||||||
elevation: 20,
|
|
||||||
),
|
|
||||||
pageTransitionsTheme: const PageTransitionsTheme(
|
pageTransitionsTheme: const PageTransitionsTheme(
|
||||||
builders: <TargetPlatform, PageTransitionsBuilder>{
|
builders: <TargetPlatform, PageTransitionsBuilder>{
|
||||||
TargetPlatform.android: ZoomPageTransitionsBuilder(
|
TargetPlatform.android: ZoomPageTransitionsBuilder(
|
||||||
@ -162,13 +145,6 @@ class MyApp extends StatelessWidget {
|
|||||||
? lightColorScheme
|
? lightColorScheme
|
||||||
: darkColorScheme,
|
: darkColorScheme,
|
||||||
useMaterial3: true,
|
useMaterial3: true,
|
||||||
snackBarTheme: SnackBarThemeData(
|
|
||||||
actionTextColor: darkColorScheme.primary,
|
|
||||||
backgroundColor: darkColorScheme.secondaryContainer,
|
|
||||||
closeIconColor: darkColorScheme.secondary,
|
|
||||||
contentTextStyle: TextStyle(color: darkColorScheme.secondary),
|
|
||||||
elevation: 20,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
localizationsDelegates: const [
|
localizationsDelegates: const [
|
||||||
GlobalCupertinoLocalizations.delegate,
|
GlobalCupertinoLocalizations.delegate,
|
||||||
@ -184,8 +160,9 @@ class MyApp extends StatelessWidget {
|
|||||||
return FlutterSmartDialog(
|
return FlutterSmartDialog(
|
||||||
toastBuilder: (String msg) => CustomToast(msg: msg),
|
toastBuilder: (String msg) => CustomToast(msg: msg),
|
||||||
child: MediaQuery(
|
child: MediaQuery(
|
||||||
data: MediaQuery.of(context)
|
data: MediaQuery.of(context).copyWith(
|
||||||
.copyWith(textScaler: TextScaler.linear(textScale)),
|
textScaleFactor:
|
||||||
|
MediaQuery.of(context).textScaleFactor * textScale),
|
||||||
child: child!,
|
child: child!,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -199,3 +176,34 @@ class MyApp extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class MyAudioHandler extends BaseAudioHandler
|
||||||
|
with
|
||||||
|
QueueHandler, // mix in default queue callback implementations
|
||||||
|
SeekHandler {
|
||||||
|
// mix in default seek callback implementations
|
||||||
|
|
||||||
|
// The most common callbacks:
|
||||||
|
@override
|
||||||
|
Future<void> play() async {
|
||||||
|
print('play');
|
||||||
|
// All 'play' requests from all origins route to here. Implement this
|
||||||
|
// callback to start playing audio appropriate to your app. e.g. music.
|
||||||
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
@override
|
||||||
|
Future<void> pause() async {}
|
||||||
|
|
||||||
|
///
|
||||||
|
@override
|
||||||
|
Future<void> stop() async {}
|
||||||
|
|
||||||
|
///
|
||||||
|
@override
|
||||||
|
Future<void> seek(Duration position) async {}
|
||||||
|
|
||||||
|
///
|
||||||
|
@override
|
||||||
|
Future<void> skipToQueueItem(int i) async {}
|
||||||
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
enum DynamicBadgeMode { hidden, point, number }
|
|
||||||
|
|
||||||
extension DynamicBadgeModeDesc on DynamicBadgeMode {
|
|
||||||
String get description => ['隐藏', '红点', '数字'][index];
|
|
||||||
}
|
|
||||||
|
|
||||||
extension DynamicBadgeModeCode on DynamicBadgeMode {
|
|
||||||
int get code => [0, 1, 2][index];
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
enum FullScreenGestureMode {
|
|
||||||
/// 从上滑到下
|
|
||||||
fromToptoBottom,
|
|
||||||
|
|
||||||
/// 从下滑到上
|
|
||||||
fromBottomtoTop,
|
|
||||||
}
|
|
||||||
|
|
||||||
extension FullScreenGestureModeExtension on FullScreenGestureMode {
|
|
||||||
String get values => ['fromToptoBottom', 'fromBottomtoTop'][index];
|
|
||||||
String get labels => ['从上往下滑进入全屏', '从下往上滑进入全屏'][index];
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
library commonn_model;
|
|
||||||
|
|
||||||
export './business_type.dart';
|
|
||||||
export './gesture_mode.dart';
|
|
@ -1,43 +0,0 @@
|
|||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
const defaultNavigationBars = [
|
|
||||||
{
|
|
||||||
'id': 0,
|
|
||||||
'icon': Icon(
|
|
||||||
Icons.home_outlined,
|
|
||||||
size: 21,
|
|
||||||
),
|
|
||||||
'selectIcon': Icon(
|
|
||||||
Icons.home,
|
|
||||||
size: 21,
|
|
||||||
),
|
|
||||||
'label': "首页",
|
|
||||||
'count': 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'id': 1,
|
|
||||||
'icon': Icon(
|
|
||||||
Icons.motion_photos_on_outlined,
|
|
||||||
size: 21,
|
|
||||||
),
|
|
||||||
'selectIcon': Icon(
|
|
||||||
Icons.motion_photos_on,
|
|
||||||
size: 21,
|
|
||||||
),
|
|
||||||
'label': "动态",
|
|
||||||
'count': 0,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'id': 2,
|
|
||||||
'icon': Icon(
|
|
||||||
Icons.video_collection_outlined,
|
|
||||||
size: 20,
|
|
||||||
),
|
|
||||||
'selectIcon': Icon(
|
|
||||||
Icons.video_collection,
|
|
||||||
size: 21,
|
|
||||||
),
|
|
||||||
'label': "媒体库",
|
|
||||||
'count': 0,
|
|
||||||
}
|
|
||||||
];
|
|
@ -1,7 +0,0 @@
|
|||||||
// 首页推荐类型
|
|
||||||
enum RcmdType { web, app, notLogin }
|
|
||||||
|
|
||||||
extension RcmdTypeExtension on RcmdType {
|
|
||||||
String get values => ['web', 'app', 'notLogin'][index];
|
|
||||||
String get labels => ['web端', 'app端', '游客模式'][index];
|
|
||||||
}
|
|
@ -1,6 +1,6 @@
|
|||||||
enum ReplySortType { time, like }
|
enum ReplySortType { time, like, reply }
|
||||||
|
|
||||||
extension ReplySortTypeExtension on ReplySortType {
|
extension ReplySortTypeExtension on ReplySortType {
|
||||||
String get titles => ['最新评论', '最热评论'][index];
|
String get titles => ['最新评论', '最热评论', '回复最多'][index];
|
||||||
String get labels => ['最新', '最热'][index];
|
String get labels => ['最新', '最热', '最多回复'][index];
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,6 @@ enum TabType { live, rcmd, hot, bangumi }
|
|||||||
|
|
||||||
extension TabTypeDesc on TabType {
|
extension TabTypeDesc on TabType {
|
||||||
String get description => ['直播', '推荐', '热门', '番剧'][index];
|
String get description => ['直播', '推荐', '热门', '番剧'][index];
|
||||||
String get id => ['live', 'rcmd', 'hot', 'bangumi'][index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List tabsConfig = [
|
List tabsConfig = [
|
||||||
|
@ -78,14 +78,12 @@ class ItemModulesModel {
|
|||||||
this.moduleDynamic,
|
this.moduleDynamic,
|
||||||
// this.moduleInter,
|
// this.moduleInter,
|
||||||
this.moduleStat,
|
this.moduleStat,
|
||||||
this.moduleTag,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ModuleAuthorModel? moduleAuthor;
|
ModuleAuthorModel? moduleAuthor;
|
||||||
ModuleDynamicModel? moduleDynamic;
|
ModuleDynamicModel? moduleDynamic;
|
||||||
// ModuleInterModel? moduleInter;
|
// ModuleInterModel? moduleInter;
|
||||||
ModuleStatModel? moduleStat;
|
ModuleStatModel? moduleStat;
|
||||||
Map? moduleTag;
|
|
||||||
|
|
||||||
ItemModulesModel.fromJson(Map<String, dynamic> json) {
|
ItemModulesModel.fromJson(Map<String, dynamic> json) {
|
||||||
moduleAuthor = json['module_author'] != null
|
moduleAuthor = json['module_author'] != null
|
||||||
@ -98,7 +96,6 @@ class ItemModulesModel {
|
|||||||
moduleStat = json['module_stat'] != null
|
moduleStat = json['module_stat'] != null
|
||||||
? ModuleStatModel.fromJson(json['module_stat'])
|
? ModuleStatModel.fromJson(json['module_stat'])
|
||||||
: null;
|
: null;
|
||||||
moduleTag = json['module_tag'];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,28 +2,18 @@ class FollowUpModel {
|
|||||||
FollowUpModel({
|
FollowUpModel({
|
||||||
this.liveUsers,
|
this.liveUsers,
|
||||||
this.upList,
|
this.upList,
|
||||||
this.liveList,
|
|
||||||
this.myInfo,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
LiveUsers? liveUsers;
|
LiveUsers? liveUsers;
|
||||||
List<UpItem>? upList;
|
List<UpItem>? upList;
|
||||||
List<LiveUserItem>? liveList;
|
|
||||||
MyInfo? myInfo;
|
|
||||||
|
|
||||||
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
||||||
liveUsers = json['live_users'] != null
|
liveUsers = json['live_users'] != null
|
||||||
? LiveUsers.fromJson(json['live_users'])
|
? LiveUsers.fromJson(json['live_users'])
|
||||||
: null;
|
: null;
|
||||||
liveList = json['live_users'] != null
|
|
||||||
? json['live_users']['items']
|
|
||||||
.map<LiveUserItem>((e) => LiveUserItem.fromJson(e))
|
|
||||||
.toList()
|
|
||||||
: [];
|
|
||||||
upList = json['up_list'] != null
|
upList = json['up_list'] != null
|
||||||
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
||||||
: [];
|
: [];
|
||||||
myInfo = json['my_info'] != null ? MyInfo.fromJson(json['my_info']) : null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,21 +93,3 @@ class UpItem {
|
|||||||
uname = json['uname'];
|
uname = json['uname'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MyInfo {
|
|
||||||
MyInfo({
|
|
||||||
this.face,
|
|
||||||
this.mid,
|
|
||||||
this.name,
|
|
||||||
});
|
|
||||||
|
|
||||||
String? face;
|
|
||||||
int? mid;
|
|
||||||
String? name;
|
|
||||||
|
|
||||||
MyInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
face = json['face'];
|
|
||||||
mid = json['mid'];
|
|
||||||
name = json['name'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -17,9 +17,8 @@ class LatestDataModel {
|
|||||||
url = json['url'];
|
url = json['url'];
|
||||||
tagName = json['tag_name'];
|
tagName = json['tag_name'];
|
||||||
createdAt = json['created_at'];
|
createdAt = json['created_at'];
|
||||||
assets = json['assets'] != null
|
assets =
|
||||||
? json['assets'].map<AssetItem>((e) => AssetItem.fromJson(e)).toList()
|
json['assets'].map<AssetItem>((e) => AssetItem.fromJson(e)).toList();
|
||||||
: [];
|
|
||||||
body = json['body'];
|
body = json['body'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import 'package:pilipala/utils/id_utils.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
|
||||||
|
part 'result.g.dart';
|
||||||
|
|
||||||
|
@HiveType(typeId: 0)
|
||||||
class RecVideoItemAppModel {
|
class RecVideoItemAppModel {
|
||||||
RecVideoItemAppModel({
|
RecVideoItemAppModel({
|
||||||
this.id,
|
this.id,
|
||||||
@ -24,27 +27,47 @@ class RecVideoItemAppModel {
|
|||||||
this.adInfo,
|
this.adInfo,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
int? id;
|
int? id;
|
||||||
|
@HiveField(1)
|
||||||
int? aid;
|
int? aid;
|
||||||
|
@HiveField(2)
|
||||||
String? bvid;
|
String? bvid;
|
||||||
|
@HiveField(3)
|
||||||
int? cid;
|
int? cid;
|
||||||
|
@HiveField(4)
|
||||||
String? pic;
|
String? pic;
|
||||||
|
@HiveField(5)
|
||||||
RcmdStat? stat;
|
RcmdStat? stat;
|
||||||
int? duration;
|
@HiveField(6)
|
||||||
|
String? duration;
|
||||||
|
@HiveField(7)
|
||||||
String? title;
|
String? title;
|
||||||
|
@HiveField(8)
|
||||||
int? isFollowed;
|
int? isFollowed;
|
||||||
|
@HiveField(9)
|
||||||
RcmdOwner? owner;
|
RcmdOwner? owner;
|
||||||
|
@HiveField(10)
|
||||||
RcmdReason? rcmdReason;
|
RcmdReason? rcmdReason;
|
||||||
|
@HiveField(11)
|
||||||
String? goto;
|
String? goto;
|
||||||
|
@HiveField(12)
|
||||||
int? param;
|
int? param;
|
||||||
|
@HiveField(13)
|
||||||
String? uri;
|
String? uri;
|
||||||
|
@HiveField(14)
|
||||||
String? talkBack;
|
String? talkBack;
|
||||||
// 番剧
|
// 番剧
|
||||||
|
@HiveField(15)
|
||||||
String? bangumiView;
|
String? bangumiView;
|
||||||
|
@HiveField(16)
|
||||||
String? bangumiFollow;
|
String? bangumiFollow;
|
||||||
|
@HiveField(17)
|
||||||
String? bangumiBadge;
|
String? bangumiBadge;
|
||||||
|
|
||||||
|
@HiveField(18)
|
||||||
String? cardType;
|
String? cardType;
|
||||||
|
@HiveField(19)
|
||||||
Map? adInfo;
|
Map? adInfo;
|
||||||
|
|
||||||
RecVideoItemAppModel.fromJson(Map<String, dynamic> json) {
|
RecVideoItemAppModel.fromJson(Map<String, dynamic> json) {
|
||||||
@ -52,32 +75,17 @@ class RecVideoItemAppModel {
|
|||||||
? json['player_args']['aid']
|
? json['player_args']['aid']
|
||||||
: int.parse(json['param'] ?? '-1');
|
: int.parse(json['param'] ?? '-1');
|
||||||
aid = json['player_args'] != null ? json['player_args']['aid'] : -1;
|
aid = json['player_args'] != null ? json['player_args']['aid'] : -1;
|
||||||
bvid = json['player_args'] != null
|
bvid = null;
|
||||||
? IdUtils.av2bv(json['player_args']['aid'])
|
|
||||||
: '';
|
|
||||||
cid = json['player_args'] != null ? json['player_args']['cid'] : -1;
|
cid = json['player_args'] != null ? json['player_args']['cid'] : -1;
|
||||||
pic = json['cover'];
|
pic = json['cover'];
|
||||||
stat = RcmdStat.fromJson(json);
|
stat = RcmdStat.fromJson(json);
|
||||||
// 改用player_args中的duration作为原始数据(秒数)
|
duration = json['cover_right_text'];
|
||||||
duration =
|
|
||||||
json['player_args'] != null ? json['player_args']['duration'] : -1;
|
|
||||||
//duration = json['cover_right_text'];
|
|
||||||
title = json['title'];
|
title = json['title'];
|
||||||
|
isFollowed = 0;
|
||||||
owner = RcmdOwner.fromJson(json);
|
owner = RcmdOwner.fromJson(json);
|
||||||
rcmdReason = json['rcmd_reason_style'] != null
|
rcmdReason = json['rcmd_reason_style'] != null
|
||||||
? RcmdReason.fromJson(json['rcmd_reason_style'])
|
? RcmdReason.fromJson(json['rcmd_reason_style'])
|
||||||
: null;
|
: null;
|
||||||
// 由于app端api并不会直接返回与owner的关注状态
|
|
||||||
// 所以借用推荐原因是否为“已关注”、“新关注”等判别关注状态,从而与web端接口等效
|
|
||||||
isFollowed = rcmdReason != null &&
|
|
||||||
rcmdReason!.content != null &&
|
|
||||||
rcmdReason!.content!.contains('关注')
|
|
||||||
? 1
|
|
||||||
: 0;
|
|
||||||
// 如果是,就无需再显示推荐原因,交由view统一处理即可
|
|
||||||
if (isFollowed == 1) {
|
|
||||||
rcmdReason = null;
|
|
||||||
}
|
|
||||||
goto = json['goto'];
|
goto = json['goto'];
|
||||||
param = int.parse(json['param']);
|
param = int.parse(json['param']);
|
||||||
uri = json['uri'];
|
uri = json['uri'];
|
||||||
@ -94,26 +102,33 @@ class RecVideoItemAppModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 1)
|
||||||
class RcmdStat {
|
class RcmdStat {
|
||||||
RcmdStat({
|
RcmdStat({
|
||||||
this.view,
|
this.view,
|
||||||
this.like,
|
this.like,
|
||||||
this.danmu,
|
this.danmu,
|
||||||
});
|
});
|
||||||
|
@HiveField(0)
|
||||||
String? view;
|
String? view;
|
||||||
|
@HiveField(1)
|
||||||
String? like;
|
String? like;
|
||||||
|
@HiveField(2)
|
||||||
String? danmu;
|
String? danmu;
|
||||||
|
|
||||||
RcmdStat.fromJson(Map<String, dynamic> json) {
|
RcmdStat.fromJson(Map<String, dynamic> json) {
|
||||||
view = json["cover_left_text_1"];
|
view = json["cover_left_text_1"];
|
||||||
danmu = json['cover_left_text_2'] ?? '-';
|
danmu = json['cover_left_text_2'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 2)
|
||||||
class RcmdOwner {
|
class RcmdOwner {
|
||||||
RcmdOwner({this.name, this.mid});
|
RcmdOwner({this.name, this.mid});
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
String? name;
|
String? name;
|
||||||
|
@HiveField(1)
|
||||||
int? mid;
|
int? mid;
|
||||||
|
|
||||||
RcmdOwner.fromJson(Map<String, dynamic> json) {
|
RcmdOwner.fromJson(Map<String, dynamic> json) {
|
||||||
@ -126,11 +141,13 @@ class RcmdOwner {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 8)
|
||||||
class RcmdReason {
|
class RcmdReason {
|
||||||
RcmdReason({
|
RcmdReason({
|
||||||
this.content,
|
this.content,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@HiveField(0)
|
||||||
String? content;
|
String? content;
|
||||||
|
|
||||||
RcmdReason.fromJson(Map<String, dynamic> json) {
|
RcmdReason.fromJson(Map<String, dynamic> json) {
|
||||||
|