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...'); 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,