Skip to content

Commit

Permalink
Merge pull request #482 from DanXi-Dev/fix-481
Browse files Browse the repository at this point in the history
Fix 481
  • Loading branch information
w568w authored Jan 10, 2025
2 parents c86ed34 + c28808b commit 6dee343
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
8 changes: 6 additions & 2 deletions build_release.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ String dartExecutable = 'dart';
void main(List<String> 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",
Expand Down Expand Up @@ -83,6 +83,9 @@ void main(List<String> 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;
Expand Down Expand Up @@ -111,13 +114,14 @@ Future<int> runDartProcess(List<String> args) async {
return await buildProcess.exitCode;
}

Future<void> buildAndroid(String? versionCode, String gitHash) async {
Future<void> 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...');
Expand Down
29 changes: 16 additions & 13 deletions lib/page/forum/hole_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -891,19 +891,22 @@ class BBSPostDetailState extends State<BBSPostDetail> {
},
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,
Expand Down

0 comments on commit 6dee343

Please sign in to comment.