While creating integration tests for a flutter app, how to pass a dart-define
variables via gradle scripts.
From Flutter documentation, in order to build an instrumentation test apk (and later to upload it to Firebase test lab and test), we need to directly use gradlew
commands like this:
pushd android
flutter build apk
./gradlew app:assembleAndroidTest
./gradlew app:assembleDebug -Ptarget=integration_test/<name>_test.dart
popd
Here its not specified how to pass --dart-define
flag's content that we are using from flutter side flutter run
to the gradlew
command.