diff --git a/frontend_server_client/lib/src/frontend_server_client.dart b/frontend_server_client/lib/src/frontend_server_client.dart index 3a62274a4..58ef6df57 100644 --- a/frontend_server_client/lib/src/frontend_server_client.dart +++ b/frontend_server_client/lib/src/frontend_server_client.dart @@ -68,6 +68,8 @@ class FrontendServerClient { bool printIncrementalDependencies = true, List additionalSources = const [], String? nativeAssets, + // -D=key=value arguments for dart environment variables + Map? dartDefines, }) async { final commonArguments = [ '--sdk-root', @@ -97,6 +99,10 @@ class FrontendServerClient { '--native-assets', nativeAssets, ], + if (dartDefines != null) ...[ + for (var entry in dartDefines.entries) + '-D="${entry.key}=${entry.value}"', + ], ]; late final Process feServer; if (frontendServerPath != null) {