buildPlatform static method
Implementation
static Future<bool> buildPlatform(String platform) async {
final String flutterPath = FlutterReleaseXHelpers.getFlutterPath();
ProcessResult res;
switch (platform) {
case 'ios':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build ipa --release');
break;
case 'android':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build apk --release');
break;
case 'web':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build web --release');
break;
case 'macos':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build macos --release');
break;
case 'windows':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build windows --release');
break;
case 'linux':
res = await FlutterReleaseXHelpers.executeCommand(
'$flutterPath build linux --release');
break;
default:
print('❌ Unsupported platform: $platform');
return false;
}
// ✅ Log command result for debugging
if (res.exitCode == 0) {
print('✅ Build successful for $platform: ${res.stdout}');
} else {
print('❌ Build failed for $platform: ${res.stderr}');
}
return res.exitCode == 0;
}