I am using a --dart-define=myEnv=production parameter to define the app environment for build. (this is not the same as --release or --debug flutter build arguments).
When building with the --dart-define=myEnv=prod parameter, I need to have one application icon, and for build with a different value of myEnv variable or without this variable, I need to have another app icon.
I am not using any third-party libraries for the icon.
My Android icons are stored in the path: android/app/src/main/res
And iOS icons are stored in the path: ios/Runner/Assets.xcassets/AppIcon.appiconset
I just want to put the second icons on different paths, and in the Info.plist and AndroidManifest.xml files indicate something like:
...
<key>CFBundleIconFile</key>
<string>$myEnv/icon.png</string>
...
<application
tools:replace="android:label,android:theme"
android:name=".Application"
android:label="MyCoolApp"
android:theme="@style/Theme.AppCompat"
android:icon=$myEnv/"@mipmap/launcher_icon">
...