Repository: flutter
Issue: Behavior of const String.fromEnvironment on different platform
Labels: platform-ios,tool,P3,team-ios,triaged-ios

### Is there an existing issue for this?

- [X] I have searched the [existing issues](https://github.com/flutter/flutter/issues)
- [X] I have read the [guide to filing a bug](https://flutter.dev/docs/resources/bug-reports)

### Steps to reproduce

1. Uninstalled existing build from test device, ran `flutter clean`, `pod repo update`, `pod update`, and `pod install`
2. I have tried to remove all Pre-build script regarding translating base64 Dart Defines under each Xcode Target Scheme as well, expecting a difference (this is an old project which has been migrated to recent Flutter version)
3. Executed `flutter run` or `flutter build` (with flavors) including the Dart Defines
4. Noticed the `const String.fromEnvironment('...')` returned wrong value, not even the default fallback value on iOS
5. Tested same app and command on Android, everything worked fine.

What I would like to know, where should I start to troubleshoot regarding this issue?
Do I have to copy the existing code base to a new project and re-setup the iOS flavors (Schemes) instead?  

Given that I have been able to run and build other Flutter Apps on iOS on the same machine with the same approach without encountering such issue, indicates that there must be something to do with the Xcode configuration, which I need a clue about it.

### Expected results

Both Android and iOS should show the same result

### Actual results

iOS showed old used value instead, ignoring new values from the commands

For example
```console
flutter run --flavor dev --dart-define=host=dev.mymb.com
```
And let's say my old host was `demo.dev.mymb.com`, if I executed the above's command, on Android, printing the `host` would show correct result, while on iOS it showed the old one. Same thing also happened with `flutter build` command.

### Code sample

<details><summary>Code sample</summary>

```dart
const host = const String.fromEnvironment('host',);
// It's working correctly when executed on Android, but on iOS it persisted the old value
print(host,);
```

</details>


### Screenshots or Video

<details>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details><summary>Logs</summary>

```console
[Paste your logs here]
```

</details>


### Flutter Doctor output

<details><summary>Doctor output</summary>

```console
[✓] Flutter (Channel stable, 3.7.12, on macOS 13.3.1 22E772610a darwin-arm64, locale en-ID)
    • Flutter version 3.7.12 on channel stable at /Users/.../development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (4 weeks ago), 2023-04-17 21:47:46 -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/soluixdeveloper/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E222b
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.78.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.64.0

[✓] Connected device (4 available)
    • ASUS I001DE (mobile)   • ...                          • android-arm64  • Android 11 (API 30)
    • iPhone X (mobile) • ... • ios            • iOS 16.3.1 20D67
    • macOS (desktop)        • macos                                    • darwin-arm64   • macOS 13.3.1 22E772610a darwin-arm64
    • Chrome (web)           • chrome                                   • web-javascript • Google Chrome 113.0.5672.92

[✓] HTTP Host Availability
    • All required HTTP hosts are available

```

</details>