Repository: flutter
Issue: [iOS] The `DART_OBFUSCATION` in Flutter Module is always set to `false`.
Labels: platform-ios,tool,a: existing-apps,P2,team-ios,triaged-ios

### Steps to reproduce

I have an existing iOS project integrated with Flutter code, created using a Flutter Module. I'm not sure if the project created with the Flutter Module supports setting `DART_OBFUSCATION` because every time I run `flutter pub get`, a new `flutter_export_environment.sh` file is generated, and the environment variables in it are fixed. I have no way to change them.

Many solutions for setting `DART_OBFUSCATION` suggest using `flutter build ios --obfuscate`, but my project is a Flutter Module that is integrated as a Pod dependency, and it does not directly depend on the artifacts generated by `flutter build`.

Here are my steps:

1. `flutter pub get`
2. `pod install`
3. Add a Build Phase script in Xcode: `export DART_OBFUSCATION=true`
4. Run in Xcode

### Expected results


`flutter --verbose assemble -dDartObfuscation=true`



### Actual results


The following is the result I see after running Xcode:

> /Users/xxx/flutter/bin/flutter --verbose assemble --no-version-check --output=/Users/xxx/Library/Developer/Xcode/DerivedData/elecq-bucgsyiksxemgddergcycvsvkqby/Build/Products/Debug-iphoneos/ -dTargetPlatform=ios -dTargetFile=lib/main.dart -dBuildMode=debug -dIosArchs=arm64 -dSdkRoot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOSxx.2.sdk -dSplitDebugInfo= -dTreeShakeIcons=false -dTrackWidgetCreation=true -dDartObfuscation=false -dAction=build -dFrontendServerStarterPath= --ExtraGenSnapshotOptions= --DartDefines= --ExtraFrontEndOptions= -dCodesignIdentity=F2FF21Bxxxxx9C79E90632DD92BF8473B28 debug_ios_bundle_flutter_assets

As you can see, the result for `-dDartObfuscation` remains `false` and there are no changes.

Upon my observation, I found that every time I run `pod install`, two scripts are generated in the Build Phase. The content of these scripts is already defined in `podhelper.rb`, and I do not have the opportunity to add `DART_OBFUSCATION=true`.

Here is the script code in `podhelper.rb` that sets up the scripts:

```ruby
def install_flutter_application_pod(flutter_application_path)
  flutter_application_path ||= File.join('..', '..')

  export_script_directory = File.join(flutter_application_path, '.ios', 'Flutter')

  # Keep script phase paths relative so they can be checked into source control.
  relative = flutter_relative_path_from_podfile(export_script_directory)

  flutter_export_environment_path = File.join('${SRCROOT}', relative, 'flutter_export_environment.sh')

  # Compile App.framework and move it and Flutter.framework to "BUILT_PRODUCTS_DIR"
  script_phase name: 'Run Flutter Build elecq_flutter Script',
    script: "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh build",
    execution_position: :before_compile

  # Embed App.framework AND Flutter.framework.
  script_phase name: 'Embed Flutter Build elecq_flutter Script',
    script: "set -e\nset -u\nsource \"#{flutter_export_environment_path}\"\nexport VERBOSE_SCRIPT_LOGGING=1 && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/xcode_backend.sh embed_and_thin",
    execution_position: :after_compile
end
```


### Code sample

<details open><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.1, on macOS 14.2.1 23C71 darwin-arm64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.90.2)
[✓] Proxy Configuration
[✓] Connected device (4 available)
[✓] Network resources

• No issues found!
```

</details>