Code in flutter_test_config.dart:
import 'dart:io';
...
const String _myVarConst = String.fromEnvironment('LEAK_TRACKING');
String _myVarFromPlatform = Platform.environment['LEAK_TRACKING'] ?? '';
debugPrint('!!! _myVarConst: [$_myVarConst]');
debugPrint('!!! _myVarFromPlatform: [$_myVarFromPlatform]');
With command flutter test --dart-define LEAK_TRACKING=true on mac:
!!! _myVarConst: [true]
!!! _myVarFromPlatform: []
When running on windows bots on github:
!!! _myVarConst: []
!!! _myVarFromPlatform: [true]