argumentBuilder property
Generates the command-line arguments for the Flutter build command.
Returns a list of strings that will be passed to flutter build.
Arguments are conditionally included based on their values.
Implementation
@override
List<String> get argumentBuilder => [
// Include binary type if not empty
if (binaryType.isNotEmpty) binaryType,
// Include target file specification
if (target?.isNotEmpty ?? false) '--target=$target',
// Include build mode flag
if (buildMode?.isNotEmpty ?? false) '--$buildMode',
// Include flavor specification
if (flavor?.isNotEmpty ?? false) '--flavor=$flavor',
// Include Dart defines
if (dartDefines?.isNotEmpty ?? false) '--dart-defines=$dartDefines',
// Include Dart defines file
if (dartDefinesFile?.isNotEmpty ?? false)
'--dart-defines-file=$dartDefinesFile',
// Include build name/version
if (buildName?.isNotEmpty ?? false) '--build-name=$buildName',
// Include build number/version code
if (buildNumber?.isNotEmpty ?? false) '--build-number=$buildNumber',
// Include pub get flag
if (pub) '--pub' else '--no-pub',
// Include any custom arguments
if (customArgs != null) ...customArgs!,
];