From 9a7288b2546219a5df56df0baf2c98a884b68990 Mon Sep 17 00:00:00 2001 From: w568w <1278297578@qq.com> Date: Fri, 10 Jan 2025 16:26:53 +0800 Subject: [PATCH 1/2] fix: #481 --- lib/page/forum/hole_detail.dart | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/lib/page/forum/hole_detail.dart b/lib/page/forum/hole_detail.dart index 119f415d..e7496f51 100644 --- a/lib/page/forum/hole_detail.dart +++ b/lib/page/forum/hole_detail.dart @@ -891,19 +891,22 @@ class BBSPostDetailState extends State { }, child: Text(S.of(context).share_floor), ), - PlatformContextMenuItem( - menuContext: menuContext, - onPressed: () async { - setState(() { - if ((_renderModel as Normal).selectedPerson != null) { - (_renderModel as Normal).selectedPerson = null; - } else { - (_renderModel as Normal).selectedPerson = e.anonyname; - } - }); - }, - child: Text((_renderModel as Normal).selectedPerson != null ? S.of(context).show_all_replies : S.of(context).show_this_person), - ), + if (_renderModel + case Normal(selectedPerson: var selectedPerson, hole: _)) ...[ + PlatformContextMenuItem( + menuContext: menuContext, + onPressed: () async { + setState(() { + var model = _renderModel as Normal; + model.selectedPerson = + model.selectedPerson != null ? null : e.anonyname; + }); + }, + child: Text(selectedPerson != null + ? S.of(context).show_all_replies + : S.of(context).show_this_person), + ), + ], PlatformContextMenuItem( menuContext: menuContext, isDestructive: true, From c28808b7331445f5a2a1510fea39a4470fe7591e Mon Sep 17 00:00:00 2001 From: w568w <1278297578@qq.com> Date: Fri, 10 Jan 2025 16:27:43 +0800 Subject: [PATCH 2/2] chore: support `--target android-armv8` to build armv8-only apk --- build_release.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build_release.dart b/build_release.dart index 79482a0b..628cd850 100644 --- a/build_release.dart +++ b/build_release.dart @@ -30,7 +30,7 @@ String dartExecutable = 'dart'; void main(List arguments) async { var parser = ArgParser() ..addOption("target", - allowed: ['android', 'windows', 'aab', 'linux'], + allowed: ['android', 'android-armv8', 'windows', 'aab', 'linux'], help: "The target to build for.", mandatory: true) ..addOption("versionCode", @@ -83,6 +83,9 @@ void main(List arguments) async { case 'android': await buildAndroid(versionCode, gitHash); break; + case 'android-armv8': + await buildAndroid(versionCode, gitHash, target: 'android-arm64'); + break; case 'windows': await buildWindows(versionCode, gitHash); break; @@ -111,13 +114,14 @@ Future runDartProcess(List args) async { return await buildProcess.exitCode; } -Future buildAndroid(String? versionCode, String gitHash) async { +Future buildAndroid(String? versionCode, String gitHash, {String? target}) async { print('Build for Android...'); await runFlutterProcess([ 'build', 'apk', '--release', '--dart-define=GIT_HASH=$gitHash', + if (target != null) '--target-platform=$target', ]); print('Clean old files...');