Compare commits

...

3 Commits

Author SHA1 Message Date
dom
db08af6ca5 correct scrollable position when hiding top bar
Signed-off-by: dom <githubaccount56556@proton.me>
2026-03-07 15:05:57 +08:00
dom
fefb5c837b build
Signed-off-by: dom <githubaccount56556@proton.me>
2026-03-07 15:05:57 +08:00
dom
a88429d6d7 upgrade deps
Signed-off-by: dom <githubaccount56556@proton.me>
2026-03-07 10:49:29 +08:00
6 changed files with 61 additions and 15 deletions

View File

@@ -49,7 +49,7 @@ on:
jobs:
android:
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_android == 'true' }}
if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_android == 'true' }}
name: Release Android
runs-on: ubuntu-latest
permissions: write-all
@@ -95,12 +95,24 @@ jobs:
fi
- name: Set and Extract version
if: ${{ github.event_name == 'workflow_dispatch' }}
shell: pwsh
run: lib/scripts/build.ps1 android
- name: Flutter Build Apk
- name: Flutter Build Release Apk
if: ${{ github.event_name == 'workflow_dispatch' }}
run: flutter build apk --release --split-per-abi --dart-define-from-file=pili_release.json --pub
- name: Flutter Build Dev Apk
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "${{ secrets.SIGN_KEYSTORE_BASE64_DEV }}" | base64 --decode > android/app/dev.jks
echo storeFile='dev.jks' >> android/key.properties
echo storePassword='${{ secrets.KEYSTORE_PASSWORD_DEV }}' >> android/key.properties
echo keyAlias='${{ secrets.KEY_ALIAS_DEV }}' >> android/key.properties
echo keyPassword='${{ secrets.KEY_PASSWORD_DEV }}' >> android/key.properties
flutter build apk --release --split-per-abi --android-project-arg dev=1 --pub
- name: Rename
run: |
for file in build/app/outputs/flutter-apk/app-*-release.apk; do
@@ -139,7 +151,7 @@ jobs:
path: PiliPlus_android_*_x86_64.apk
ios:
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_ios == 'true' }}
if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_ios == 'true' }}
uses: ./.github/workflows/ios.yml
permissions: write-all
with:
@@ -153,7 +165,7 @@ jobs:
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
win_x64:
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_win_x64 == 'true' }}
if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_win_x64 == 'true' }}
uses: ./.github/workflows/win_x64.yml
permissions: write-all
with:

View File

@@ -54,6 +54,14 @@ android {
signingConfig = config ?: signingConfigs["debug"]
}
release {
if (project.hasProperty("dev")) {
applicationIdSuffix = ".dev"
resValue(
type = "string",
name = "app_name",
value = "PiliPlus dev",
)
}
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"

View File

@@ -11,6 +11,8 @@ abstract class CommonPageState<T extends StatefulWidget> extends State<T> {
RxBool? _showBottomBar;
final _mainController = Get.find<MainController>();
bool get needsCorrection => false;
@override
void initState() {
super.initState();
@@ -63,11 +65,32 @@ abstract class CommonPageState<T extends StatefulWidget> extends State<T> {
bool onNotificationType2(ScrollNotification notification) {
if (!_mainController.useBottomNav) return false;
if (notification.metrics.axis == .horizontal) return false;
final metrics = notification.metrics;
if (metrics.axis == .horizontal) return false;
if (notification is ScrollUpdateNotification) {
if (notification.dragDetails == null) return false;
_updateOffset(notification.scrollDelta ?? 0.0);
final pixel = metrics.pixels;
final scrollDelta = notification.scrollDelta ?? 0;
if (pixel < 0.0 && scrollDelta > 0) return false;
if (needsCorrection) {
final value = _barOffset!.value;
final newValue = clampDouble(
value + scrollDelta,
0.0,
StyleString.topBarHeight,
);
final offset = newValue - value;
if (offset != 0) {
_barOffset!.value = newValue;
if (pixel < 0.0 && scrollDelta < 0.0 && value > 0.0) {
return false;
}
Scrollable.of(notification.context!).position.correctBy(-offset);
}
} else {
_updateOffset(scrollDelta);
}
return false;
}

View File

@@ -25,6 +25,9 @@ class _HomePageState extends CommonPageState<HomePage>
final _homeController = Get.putOrFind(HomeController.new);
final _mainController = Get.find<MainController>();
@override
bool get needsCorrection => _homeController.hideTopBar;
@override
bool get wantKeepAlive => true;

View File

@@ -14,7 +14,7 @@ import 'package:PiliPlus/utils/extension/size_ext.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:PiliPlus/utils/utils.dart';
import 'package:flutter/material.dart'hide LayoutBuilder;
import 'package:flutter/material.dart' hide LayoutBuilder;
import 'package:get/get.dart';
class SearchPage extends StatefulWidget {

View File

@@ -384,10 +384,10 @@ packages:
dependency: transitive
description:
name: dart_style
sha256: "6f6b30cba0301e7b38f32bdc9a6bdae6f5921a55f0a1eb9450e1e6515645dbb2"
sha256: "29f7ecc274a86d32920b1d9cfc7502fa87220da41ec60b55f329559d5732e2b2"
url: "https://pub.dev"
source: hosted
version: "3.1.6"
version: "3.1.7"
dbus:
dependency: transitive
description:
@@ -758,10 +758,10 @@ packages:
dependency: "direct main"
description:
name: flutter_svg
sha256: "87fbd7c534435b6c5d9d98b01e1fd527812b82e68ddd8bd35fc45ed0fa8f0a95"
sha256: "1ded017b39c8e15c8948ea855070a5ff8ff8b3d5e83f3446e02d6bb12add7ad9"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.2.4"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -857,10 +857,10 @@ packages:
dependency: transitive
description:
name: hooks
sha256: "7a08a0d684cb3b8fb604b78455d5d352f502b68079f7b80b831c62220ab0a4f6"
sha256: e79ed1e8e1929bc6ecb6ec85f0cb519c887aa5b423705ded0d0f2d9226def388
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.0.2"
html:
dependency: "direct main"
description:
@@ -1232,10 +1232,10 @@ packages:
dependency: transitive
description:
name: native_toolchain_c
sha256: "89e83885ba09da5fdf2cdacc8002a712ca238c28b7f717910b34bcd27b0d03ac"
sha256: "92b2ca62c8bd2b8d2f267cdfccf9bfbdb7322f778f8f91b3ce5b5cda23a3899f"
url: "https://pub.dev"
source: hosted
version: "0.17.4"
version: "0.17.5"
nm:
dependency: transitive
description: